Relationship vocabulary in PHOAF with RAP inference engine
I’ve just added support for Relationship vocabulary in PHOAF, so that the knows() method now recognise all Relationship properties (as they are subproperties of foaf:knows()).
I was wondering how such subproperties and inferencing could be handled in RAP, but this is actually really simple.
First, your model needs to be an InfModel (I choosed InfModelF, as the file is not supposed to evolve after being loaded). Then, you must add the statements that will define relations between properties and their “top-properties”.
Eg:
$this->add(new Statement(RELATIONSHIP::RELATIONSHIP(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS()); $this->add(new Statement(RELATIONSHIP::ACQUAINTANCE_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS()); $this->add(new Statement(RELATIONSHIP::AMBIVALENT_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS()); $this->add(new Statement(RELATIONSHIP::ANCESTOR_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS()); $this->add(new Statement(RELATIONSHIP::ANTAGONIST_OF(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS()); $this->add(new Statement(RELATIONSHIP::APPRENTICE_TO(), RDFS::SUB_PROPERTY_OF(), FOAF::KNOWS());
Now, when using $this->getMatchingStatements(NULL, FOAF::KNOWS(): NULL), and thanks to the inference engine, you’ll get all statements with rel:xxx as a predicate.
Comments
3 Responses to “Relationship vocabulary in PHOAF with RAP inference engine”
Leave a Reply
You must be logged in to post a comment.

Nice! Is this already in the latest PHOAF release? How does the InfModel affect performance?
Hi Richard,
At the moment, this is only in CVS. but a v0.4 will be released soon.
I didn’t run any performance test yet, I’ll certainly do it at the same time, taking a few FOAF files into account to see how it does affect parsing time.
Hey, that’s really cool. Didn’t know it did that….