使用 Protege 和 SWRL 选项卡,我有下面提到的本体。它由班级Test
和班级组成Shadow
,其中Test
有三个人t1, t2, t3
。我试图定义一个 SWRL 规则,Shadow
为 的每个现有个体创建一个类个体Test
,该规则是
Test(?x) ^ swrlx:makeOWLThing(?new, ?x) -> Shadow(?new)
问题:
Shadow
只创建了, named的一个个体fred
,而不是三个(对应于t1, t2, t3
)。如何控制始终命名的结果个体的命名
fred
?Prefix(:=<http://www.semanticweb.org/hilal/ontologies/2016/5/untitled- ontology-58#>) Prefix(owl:=<http://www.w3.org/2002/07/owl#>) Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>) Prefix(xml:=<http://www.w3.org/XML/1998/namespace>) Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>) Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>) Ontology(<http://www.semanticweb.org/hilal/ontologies/2016/5/untitled- ontology-58> Declaration(Class(:Shadow)) Declaration(Class(:Test)) Declaration(NamedIndividual(:t1)) Declaration(NamedIndividual(:t2)) Declaration(NamedIndividual(:t3)) Declaration(AnnotationProperty(<http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled>)) ############################ # Named Individuals ############################ # Individual: :t1 (:t1) ClassAssertion(:Test :t1) # Individual: :t2 (:t2) ClassAssertion(:Test :t2) # Individual: :t3 (:t3) ClassAssertion(:Test :t3) DLSafeRule(Annotation(<http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled> "true"^^xsd:boolean) Annotation(rdfs:comment ""^^xsd:string) Annotation(rdfs:label "S1"^^xsd:string) Body(BuiltInAtom(<http://swrl.stanford.edu/ontologies/built-ins/3.3/swrlx.owl#makeOWLThing> Variable(<new>) Variable(<x>)) ClassAtom(:Test Variable(<x>)))Head(ClassAtom(:Shadow Variable(<new>)))) )