質問

In OWL API, classes may have data properties. For e.g. a class may have a date property hasCommonName "Something". In OWL API, is there any facility like the SQL like which allows querying for classes that hasCommonName containing the word "Some", just like SQL like behave

役に立ちましたか?

解決

You can use regular expressions to identify the things you need. Consider the following knowledge base:

DataProperty: hasCommonName

Individual: foo

Facts:  
 hasCommonName "Something"

You can retrieve the individual foo by using the following class expression: hasCommonName some string[pattern "Some.*"]. The string[pattern "Some.*"] specifies the pattern to be matched. Warning, currently not supported by all reasoners (works for Hermit 1.3.7)

他のヒント

You need to look at some SPARQL tutorials. You can write something like this:

SELECT * WHERE
{
  ?pizza rdfs:subClassof [
  owl:onProperty :hasTopping;
  owl:someValuesFrom :TomatoTopping ] .
}

Basically, you need to define the correct predicate based on your restriction.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top