Using Protege and SWRL tab, I have the ontology mentioned hereinafter. It is composed of the Class Test and the class Shadow, where Test has three individuals t1, t2, t3. I was trying to define an SWRL rule that creates an individual of Shadow class for each existing individual of Test, the rule is

Test(?x) ^ swrlx:makeOWLThing(?new, ?x) -> Shadow(?new)

QUESTIONS:

1. Only one individual of Shadow, named fred is created, instead of three (corresponding to t1, t2, t3).

2. How to control the naming of the resulting individual which is always named fred?

Here is my ontology:

Prefix(:=)

Prefix(owl:=)

Prefix(rdf:=)

Prefix(xml:=)

Prefix(xsd:=)

Prefix(rdfs:=)

Ontology(

Declaration(Class(:Shadow))

Declaration(Class(:Test))

Declaration(NamedIndividual(:t1))

Declaration(NamedIndividual(:t2))

Declaration(NamedIndividual(:t3))

Declaration(AnnotationProperty())

############################

# Named Individuals

############################

# Individual: :t1 (:t1)

ClassAssertion(:Test :t1)

# Individual: :t2 (:t2)

ClassAssertion(:Test :t2)

# Individual: :t3 (:t3)

ClassAssertion(:Test :t3)

DLSafeRule(Annotation( "true"^^xsd:boolean) Annotation(rdfs:comment ""^^xsd:string) Annotation(rdfs:label "S1"^^xsd:string) Body(BuiltInAtom( Variable() Variable()) ClassAtom(:Test Variable()))Head(ClassAtom(:Shadow Variable())))

)

More Median m. Hilal's questions See All
Similar questions and discussions