use of fr.lirmm.graphik.util.Prefix in project graal by graphik-team.
the class OWL2ParserTest method dataRangeIntersection.
@Test
public void dataRangeIntersection() throws OWL2ParserException {
// D(Y) :- p(X, Y).
OWL2Parser parser = new OWL2Parser(PREFIXES + ":p rdf:type owl:DatatypeProperty . " + ":D rdf:type rdfs:Datatype ." + ":E rdf:type rdfs:Datatype." + ":p rdfs:range [owl:intersectionOf ( :D :E ) ] .");
int nbAssertions = 0;
while (parser.hasNext()) {
Object o = parser.next();
if (!(o instanceof Prefix)) {
Assert.assertTrue(o instanceof Rule);
++nbAssertions;
}
}
parser.close();
Assert.assertEquals("Number of assertions found:", 2, nbAssertions);
}
use of fr.lirmm.graphik.util.Prefix in project graal by graphik-team.
the class OWL2ParserTest method dataAllValuesFrom.
@Test
public void dataAllValuesFrom() throws OWL2ParserException {
// D(Y) :- p(X,Y) A(X).
OWL2Parser parser = new OWL2Parser(PREFIXES + ":A a owl:Class. " + ":D a rdfs:Datatype. " + ":p rdf:type owl:DatatypeProperty . " + ":A rdfs:subClassOf [a owl:Restriction; owl:onProperty :p; owl:allValuesFrom :D].");
int nbAssertions = 0;
while (parser.hasNext()) {
Object o = parser.next();
if (!(o instanceof Prefix)) {
Assert.assertTrue(o instanceof Rule);
++nbAssertions;
}
}
parser.close();
Assert.assertEquals("Number of assertions found:", 1, nbAssertions);
}
use of fr.lirmm.graphik.util.Prefix in project graal by graphik-team.
the class OWL2ParserTest method illegalAllValuesFromMaskedInUnion.
@Test
public void illegalAllValuesFromMaskedInUnion() throws OWL2ParserException {
OWL2Parser parser = new OWL2Parser(PREFIXES + " :A a owl:Class. " + ":B a owl:Class. :C a owl:Class. " + ":p a owl:ObjectProperty. " + "[owl:unionOf ( :A [rdf:type owl:Restriction; " + " owl:onProperty :p ; " + " owl:allValuesFrom :B] ) ] rdfs:subClassOf :C .");
int nbAssertion = 0;
while (parser.hasNext()) {
Object o = parser.next();
if (!(o instanceof Prefix)) {
++nbAssertion;
}
}
parser.close();
Assert.assertEquals("Number of assertions found:", 1, nbAssertion);
}
use of fr.lirmm.graphik.util.Prefix in project graal by graphik-team.
the class OWL2ParserTest method dataSomeValuesFrom.
@Test
public void dataSomeValuesFrom() throws OWL2ParserException {
// p(X,Y) D(Y) :- A(X).
OWL2Parser parser = new OWL2Parser(PREFIXES + ":A a owl:Class. " + ":D a rdfs:Datatype. " + ":p rdf:type owl:DatatypeProperty . " + ":A rdfs:subClassOf [a owl:Restriction; owl:onProperty :p; owl:someValuesFrom :D].");
int nbAssertions = 0;
while (parser.hasNext()) {
Object o = parser.next();
if (!(o instanceof Prefix)) {
Assert.assertTrue(o instanceof Rule);
++nbAssertions;
}
}
parser.close();
Assert.assertEquals("Number of assertions found:", 1, nbAssertions);
}
use of fr.lirmm.graphik.util.Prefix in project graal by graphik-team.
the class OWL2ParserTest method complexDataMinCardinality0InRightHandSide.
@Test
public void complexDataMinCardinality0InRightHandSide() throws OWL2ParserException {
OWL2Parser parser = new OWL2Parser(PREFIXES + ":D rdf:type rdfs:Datatype . " + ":B rdf:type owl:Class . " + ":p rdf:type owl:DatatypeProperty . " + " :B rdfs:subClassOf [a owl:Restriction; owl:onProperty :p; owl:someValuesFrom [ rdf:type owl:Restriction ; " + " owl:onProperty :p ; " + " owl:onDataRange :D ; " + " owl:minCardinality 0 ] ]. ");
int nbAssertions = 0;
while (parser.hasNext()) {
Object o = parser.next();
if (!(o instanceof Prefix)) {
++nbAssertions;
}
}
parser.close();
Assert.assertEquals("Number of assertions found:", 1, nbAssertions);
}
Aggregations