0

次の例を想定します (下の画像を参照): 個体 "bmw-x5" はオブジェクト プロパティ アサーション "has-type car" を持っています。このオブジェクト プロパティには、値が「4」の注釈プロパティ「wheels」があります。

OWL API を使用して、オブジェクト プロパティ アサーション「hastype car」である個別の「bmw-x5」を取得することができました。私は今、注釈プロパティ「ホイール」にこだわっています。OWL APIからその値を取得するにはどうすればよいですか?

    <ObjectPropertyAssertion>
        <Annotation>
            <AnnotationProperty IRI="#wheels"/>
            <Literal datatypeIRI="&rdf;PlainLiteral">4</Literal>
        </Annotation>
        <ObjectProperty IRI="#has-type"/>
        <NamedIndividual IRI="#bmw-x5"/>
        <NamedIndividual IRI="#car"/>
    </ObjectPropertyAssertion>

ここに画像の説明を入力

4

1 に答える 1

0

オブジェクト プロパティ アサーションの公理を把握している場合は、次のように注釈を使用できます。

OWLObjectAssertionAxiom axiom = ...
for(OWLAnnotation a: axiom.getAnnotations()) {
    // this cycle will go over all annotations, with annotation property and annotation value
}

特定の個人のすべてのオブジェクト プロパティ アサーションの公理にアクセスするには、次を使用できます。

Set<OWLObjectAssertionAxiom> set = ontology.getObjectPropertyAssertionAxioms(individual);
于 2014-10-05T18:10:38.217 に答える