Instantiate an individual inside a 'then' stardog rule section.

2 views
Skip to first unread message

Agustín Martínez

unread,
Oct 3, 2014, 9:42:50 AM10/3/14
to sta...@clarkparsia.com
Hi. I'm wondering if i can instantiate an indivudal using a Stardog native rule.
For example:

[] a rule:SPARQLRule ;
  rule:content """
PREFIX : <http://MyExample#>
    IF {
?individual rdf:type :ClassOne;
:has_relWith ?otherIndividual.
                ?otherIndividual rdf:type :ClassTwo.
      }
    THEN {
                http://MyExample#newIndividualOfClassThreeIdXX rdf:type :ClassThree.    // Can i generate an aleatory number or use a sequence to add an id to the new Individual?
      }""" .

The problem is that, obviously, i need to generate a triplet with a different id for each individual.
If there's no way to do that, i was thinking about a Trigger. Did Stardog have something similar?

Regards,
Agustín 

Héctor Pérez-Urbina

unread,
Oct 3, 2014, 10:25:58 AM10/3/14
to stardog
Take a look at the "New Individuals with SWRL" section in [1].


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en



--
Best,
Héctor

Agustín Martínez

unread,
Oct 3, 2014, 2:04:48 PM10/3/14
to sta...@clarkparsia.com
Hector, thanks!
I've done that but i have another problem. In my example, several ClassOne individuals can have a rel with a ClassTwo individual. The problem is that i have to to do something like this: If there's a rel between 1 ClassOne individual and one or more ClassTwo individuals, i just need ONE new ClassThree individual. Not one for each rel.

Thanks again,
Agustin
Reply all
Reply to author
Forward
0 new messages