Как я могу получить родительский класс коллекции owl: intersectionOf?
Например:
<owl:Class rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#Country"> <owl:equivalentClass> <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#DomainConcept"/> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#America"/> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#England"/> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#France"/> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#Germany"/> <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#Italy"/> </owl:oneOf> </owl:Class> </owl:intersectionOf> </owl:Class> </owl:equivalentClass> <rdfs:comment xml:lang="en">A class that is equivalent to the set of individuals that are described in the enumeration - ie Countries can only be either America, England, France, Germany or Italy and nothing else. Note that these individuals have been asserted to be allDifferent from each other.</rdfs:comment> <rdfs:label xml:lang="en">Country</rdfs:label> <rdfs:label xml:lang="pt">Pais</rdfs:label> <skos:prefLabel xml:lang="en">Country</skos:prefLabel> </owl:Class>
Я хочу получить в ответ Страна когдаУ меня есть параметр Италия
Наконец-то я нашел решение своего вопроса.
PREFIX :<http://www.co-ode.org/ontologies/pizza/pizza.owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?parent FROM <http://localhost:8080/PizzaDS/data/PizzaGraph> WHERE { :Italy rdf:type/rdfs:subClassOf* ?parent. FILTER(regex(str(?parent), "Country")). }
С помощью этого запроса я получаю правильный ответ ": Страна"