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.