从OWL类中提取值

时间:2012-02-28 19:17:53

标签: java ontology owl

我正在使用FaCT ++推理器和此处提供的Manchester OWL API:http://owlapi.sourceforge.net/

我有一个详细说明元素周期表中元素的OWL,但是我很难提取某些属性的文字值。在下面的示例中,我想从标记之间提取整数。

<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>

<owl:hasValue rdf:datatype="&xsd;integer">13</owl:hasValue>

我经常探索API,但我似乎无法找到任何能让我直接提取的东西。到目前为止,我已经能够遍历

<owl:onProperty rdf:resource="&atoms;contains"/>

但没有进一步。

每个元素都在owl:Class中描述。这里没有人宣布。

<owl:Class rdf:about="&atoms;AluminumAtom">
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&atoms;hasValenceElectronShell"/>
            <owl:allValuesFrom>
                <owl:Class>
                    <owl:unionOf rdf:parseType="Collection">
                        <owl:Class>
                            <owl:intersectionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="&atoms;PShell"/>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;contains"/>
                                    <owl:onClass rdf:resource="&atoms;Electron"/>
                                    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
                                </owl:Restriction>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;hasOrder"/>
                                    <owl:hasValue rdf:datatype="&xsd;integer">3</owl:hasValue>
                                </owl:Restriction>
                            </owl:intersectionOf>
                        </owl:Class>
                        <owl:Class>
                            <owl:intersectionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="&atoms;SShell"/>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;contains"/>
                                    <owl:onClass rdf:resource="&atoms;Electron"/>
                                    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:qualifiedCardinality>
                                </owl:Restriction>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;hasOrder"/>
                                    <owl:hasValue rdf:datatype="&xsd;integer">3</owl:hasValue>
                                </owl:Restriction>
                            </owl:intersectionOf>
                        </owl:Class>
                    </owl:unionOf>
                </owl:Class>
            </owl:allValuesFrom>
        </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="&atoms;Atom"/>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&atoms;hasValenceElectronShell"/>
                    <owl:someValuesFrom>
                        <owl:Class>
                            <owl:intersectionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="&atoms;PShell"/>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;contains"/>
                                    <owl:onClass rdf:resource="&atoms;Electron"/>
                                    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
                                </owl:Restriction>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;hasOrder"/>
                                    <owl:hasValue rdf:datatype="&xsd;integer">3</owl:hasValue>
                                </owl:Restriction>
                            </owl:intersectionOf>
                        </owl:Class>
                    </owl:someValuesFrom>
                </owl:Restriction>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&atoms;hasValenceElectronShell"/>
                    <owl:someValuesFrom>
                        <owl:Class>
                            <owl:intersectionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="&atoms;SShell"/>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;contains"/>
                                    <owl:onClass rdf:resource="&atoms;Electron"/>
                                    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:qualifiedCardinality>
                                </owl:Restriction>
                                <owl:Restriction>
                                    <owl:onProperty rdf:resource="&atoms;hasOrder"/>
                                    <owl:hasValue rdf:datatype="&xsd;integer">3</owl:hasValue>
                                </owl:Restriction>
                            </owl:intersectionOf>
                        </owl:Class>
                    </owl:someValuesFrom>
                </owl:Restriction>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&atoms;hasValenceElectronShell"/>
                    <owl:allValuesFrom>
                        <owl:Class>
                            <owl:unionOf rdf:parseType="Collection">
                                <rdf:Description rdf:about="&atoms;PShell"/>
                                <rdf:Description rdf:about="&atoms;SShell"/>
                            </owl:unionOf>
                        </owl:Class>
                    </owl:allValuesFrom>
                </owl:Restriction>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="&atoms;hasAtomicNumber"/>
                    <owl:hasValue rdf:datatype="&xsd;integer">13</owl:hasValue>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </rdfs:subClassOf>
</owl:Class>

0 个答案:

没有答案