Github user ejwhite922 commented on a diff in the pull request:
https://github.com/apache/incubator-rya/pull/215#discussion_r134877065
--- Diff: extras/indexingExample/src/main/java/MongoRyaDirectExample.java
---
@@ -572,6 +573,108 @@ public static void testAllValuesFromInference(final
SailRepositoryConnection con
Validate.isTrue(resultHandler.getCount() == 2);
}
+ public static void testOneOfInference(final SailRepositoryConnection
conn, final Sail sail) throws MalformedQueryException, RepositoryException,
UpdateExecutionException, QueryEvaluationException,
TupleQueryResultHandlerException, InferenceEngineException {
+ log.info("Adding Data");
+ final String instances = "INSERT DATA"
+ + "{ GRAPH <http://updated/test> {\n"
+ + " <urn:FlopCard1> a <urn:Card> . \n"
+ + " <urn:FlopCard1> <urn:HasRank> <urn:Ace> . \n"
+ + " <urn:FlopCard1> <urn:HasSuit> <urn:Diamonds> . \n"
+ + " <urn:FlopCard2> a <urn:Card> . \n"
+ + " <urn:FlopCard2> <urn:HasRank> <urn:Ace> . \n"
+ + " <urn:FlopCard2> <urn:HasSuit> <urn:Hearts> . \n"
+ + " <urn:FlopCard3> a <urn:Card> . \n"
+ + " <urn:FlopCard3> <urn:HasRank> <urn:King> . \n"
+ + " <urn:FlopCard3> <urn:HasSuit> <urn:Spades> . \n"
+ + " <urn:TurnCard> a <urn:Card> . \n"
+ + " <urn:TurnCard> <urn:HasRank> <urn:10> . \n"
+ + " <urn:TurnCard> <urn:HasSuit> <urn:Clubs> . \n"
+ + " <urn:RiverCard> a <urn:Card> . \n"
+ + " <urn:RiverCard> <urn:HasRank> <urn:Queen> . \n"
+ + " <urn:RiverCard> <urn:HasSuit> <urn:Hearts> . \n"
+ + "}}";
+ Update update = conn.prepareUpdate(QueryLanguage.SPARQL,
instances);
+ update.execute();
+ final String inferQuery = "select distinct ?card { GRAPH
<http://updated/test> { ?card a <urn:Card> . ?suit a <urn:Suits> . ?card
<urn:HasSuit> ?suit} } \n";
+ final String explicitQuery = "select distinct ?card { GRAPH
<http://updated/test> {\n"
+ + " { ?card <urn:HasSuit> <urn:Clubs> }\n"
--- End diff --
The explicitQuery doesn't have the ontology information yet (i.e. urn:Card
is a subClass of the Range property restrictions on urn:hasRank and
urn:hasSuit) to show how something would be done without using owl:oneOf. I
guess inferQuery is a little out of place and should be moved down closer to
where it's called.
I'll change subClassOf to equivalentClass.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---