@Test public void testInferDomain() throws Exception { schema.processTriple(TestUtils.statement(TestUtils.uri("hasAlumnus"), RDFS.DOMAIN, TestUtils.uri("University"))); reasoner.processFact(TestUtils.fact(TestUtils.NODE, TestUtils.uri("hasAlumnus"), TestUtils.uri("John Doe"))); Assert.assertTrue("Type not derived from rdfs:domain", reasoner.types.knownTypes.containsKey(TestUtils.uri("University"))); }
public void processFact(Fact fact) { Resource subject = fact.getSubject(); IRI pred = fact.getPredicate(); Value object = fact.getObject(); boolean recursive = fact.getIteration() == currentIteration; boolean incoming = object.equals(node); boolean outgoing = subject.equals(node); boolean skipReflexive = incoming && outgoing && recursive; if (incoming && !skipReflexive) { processIncoming(fact); } if (outgoing) { if (pred.equals(RDF.TYPE)) { types.processType(fact); } else { processOutgoing(fact); } } Set<Fact> resultsSoFar = getFacts(); for (Fact newFact : resultsSoFar) { processFact(newFact); } newFacts.addAll(resultsSoFar); }
LocalReasoner extends AbstractReasoner { public void processFact(Fact fact) { Resource subject = fact.getSubject(); IRI pred = fact.getPredicate(); Value object = fact.getObject(); boolean recursive = fact.getIteration() == currentIteration; boolean incoming = object.equals(node); boolean outgoing = subject.equals(node); boolean skipReflexive = incoming && outgoing && recursive; if (incoming && !skipReflexive) { processIncoming(fact); } if (outgoing) { if (pred.equals(RDF.TYPE)) { types.processType(fact); } else { processOutgoing(fact); } } Set<Fact> resultsSoFar = getFacts(); for (Fact newFact : resultsSoFar) { processFact(newFact); } newFacts.addAll(resultsSoFar); } }
LocalReasoner extends AbstractReasoner { public void processFact(Fact fact) { Resource subject = fact.getSubject(); IRI pred = fact.getPredicate(); Value object = fact.getObject(); boolean recursive = fact.getIteration() == currentIteration; boolean incoming = object.equals(node); boolean outgoing = subject.equals(node); boolean skipReflexive = incoming && outgoing && recursive; if (incoming && !skipReflexive) { processIncoming(fact); } if (outgoing) { if (pred.equals(RDF.TYPE)) { types.processType(fact); } else { processOutgoing(fact); } } Set<Fact> resultsSoFar = getFacts(); for (Fact newFact : resultsSoFar) { processFact(newFact); } newFacts.addAll(resultsSoFar); } LocalReasoner(Resource node, Schema schema, int t, int tSchema); }
LocalReasoner extends AbstractReasoner { public void processFact(Fact fact) { Resource subject = fact.getSubject(); IRI pred = fact.getPredicate(); Value object = fact.getObject(); boolean recursive = fact.getIteration() == currentIteration; boolean incoming = object.equals(node); boolean outgoing = subject.equals(node); boolean skipReflexive = incoming && outgoing && recursive; if (incoming && !skipReflexive) { processIncoming(fact); } if (outgoing) { if (pred.equals(RDF.TYPE)) { types.processType(fact); } else { processOutgoing(fact); } } Set<Fact> resultsSoFar = getFacts(); for (Fact newFact : resultsSoFar) { processFact(newFact); } newFacts.addAll(resultsSoFar); } LocalReasoner(Resource node, Schema schema, int t, int tSchema); static Relevance relevantFact(Fact fact, Schema schema); static Relevance relevantJoinRule(Fact fact, Schema schema); void processFact(Fact fact); void getTypes(); @Override boolean hasInconsistencies(); @Override Set<Fact> getFacts(); @Override Set<Derivation> getInconsistencies(); @Override String getDiagnostics(); @Override int getNumStored(); }
LocalReasoner extends AbstractReasoner { public void processFact(Fact fact) { Resource subject = fact.getSubject(); IRI pred = fact.getPredicate(); Value object = fact.getObject(); boolean recursive = fact.getIteration() == currentIteration; boolean incoming = object.equals(node); boolean outgoing = subject.equals(node); boolean skipReflexive = incoming && outgoing && recursive; if (incoming && !skipReflexive) { processIncoming(fact); } if (outgoing) { if (pred.equals(RDF.TYPE)) { types.processType(fact); } else { processOutgoing(fact); } } Set<Fact> resultsSoFar = getFacts(); for (Fact newFact : resultsSoFar) { processFact(newFact); } newFacts.addAll(resultsSoFar); } LocalReasoner(Resource node, Schema schema, int t, int tSchema); static Relevance relevantFact(Fact fact, Schema schema); static Relevance relevantJoinRule(Fact fact, Schema schema); void processFact(Fact fact); void getTypes(); @Override boolean hasInconsistencies(); @Override Set<Fact> getFacts(); @Override Set<Derivation> getInconsistencies(); @Override String getDiagnostics(); @Override int getNumStored();  }