使用jena API(java)从OWL文件获取RDF元素值(rdf:Description,rdf:about)

时间:2017-11-27 16:35:14

标签: rdf jena owl

我正在寻找一种方法如何从下面的OWL类中获取rdf属性的值(rdf:about,rdf:parseType,rdf:Description)。

我正在使用JENA java API,但我无法看到任何API来获取这些RDF属性或标记值。

如果你可以帮我解决这个问题,我将很高兴

 <owl:Class rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#SpicyPizzaEquivalent">
    <owl:equivalentClass>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza"/>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.co-ode.org/ontologies/pizza/pizza.owl#hasTopping"/>
                    <owl:someValuesFrom>
                        <owl:Class>
                            <owl:intersectionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="http://www.co-ode.org/ontologies/pizza/pizza.owl#PizzaTopping"/>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="http://www.co-ode.org/ontologies/pizza/pizza.owl#hasSpiciness"/>
                                    <owl:someValuesFrom rdf:resource="http://www.co-ode.org/ontologies/pizza/pizza.owl#Hot"/>
                                </owl:Restriction>
                            </owl:intersectionOf>
                        </owl:Class>
                    </owl:someValuesFrom>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </owl:equivalentClass>
    <rdfs:comment xml:lang="en">An alternative definition for the SpicyPizza which does away with needing a definition of SpicyTopping and uses a slightly more complicated restriction: Pizzas that have at least one topping that is both a PizzaTopping and has spiciness hot are members of this class.</rdfs:comment>
    <rdfs:label xml:lang="pt">PizzaTemperadaEquivalente</rdfs:label>
    <rdfs:label xml:lang="en">SpicyPizzaEquivalent</rdfs:label>
    <skos:prefLabel xml:lang="en">Spicy Pizza Equivalent</skos:prefLabel>
</owl:Class>

0 个答案:

没有答案