Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
update Test class
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebaallahibrahim committed Nov 28, 2019
1 parent 87a8e66 commit 914e91c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 73 deletions.
107 changes: 42 additions & 65 deletions sansa-owl-spark/src/test/resources/ont_OWLXML.owl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
</owl:ObjectProperty>



<!-- http://ex.com/bar#objProp1 -->

<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1">
Expand All @@ -113,8 +111,6 @@
</owl:propertyDisjointWith>
</owl:ObjectProperty>



<!-- http://ex.com/bar#objProp2 -->

<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp2">
Expand All @@ -123,22 +119,16 @@
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#IrreflexiveProperty"/>
</owl:ObjectProperty>



<!-- http://ex.com/bar#sameAsObjProp1 -->

<owl:ObjectProperty rdf:about="http://ex.com/bar#sameAsObjProp1"/>



<!-- http://ex.com/bar#subObjProp1 -->

<owl:ObjectProperty rdf:about="http://ex.com/bar#subObjProp1">
<rdfs:subPropertyOf rdf:resource="http://ex.com/bar#objProp1"/>
</owl:ObjectProperty>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
Expand All @@ -161,16 +151,13 @@
</owl:propertyDisjointWith>
</owl:DatatypeProperty>



<!-- http://ex.com/bar#dataProp2 -->
<!-- http://ex.com/bar#dataProp2 -->

<owl:DatatypeProperty rdf:about="http://ex.com/bar#dataProp2">
<rdfs:domain rdf:resource="http://ex.com/bar#Cls1"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/>
</owl:DatatypeProperty>


<!-- http://ex.com/bar#sameAsDataProp1 -->

<owl:DatatypeProperty rdf:about="http://ex.com/bar#sameAsDataProp1"/>
Expand All @@ -181,8 +168,6 @@
<rdfs:subPropertyOf rdf:resource="http://ex.com/bar#dataProp1"/>
</owl:DatatypeProperty>



<!--
///////////////////////////////////////////////////////////////////////////////////////
//
Expand All @@ -203,8 +188,6 @@
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#AllProp1Cls1 -->

<owl:Class rdf:about="http://ex.com/bar#AllProp1Cls1">
Expand All @@ -216,8 +199,6 @@
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#Cl1OrNegate -->

<owl:Class rdf:about="http://ex.com/bar#Cl1OrNegate">
Expand All @@ -227,8 +208,6 @@
</owl:disjointUnionOf>
</owl:Class>



<!-- http://ex.com/bar#Cls1 -->

<owl:Class rdf:about="http://ex.com/bar#Cls1">
Expand All @@ -243,12 +222,17 @@
<foo:ann>some annotation</foo:ann>
</owl:Class>

<!--<owl:Axiom>-->
<!--<owl:annotatedSource rdf:resource="http://ex.com/bar#Cls1"/>-->
<!--<owl:annotatedProperty rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>-->
<!--<owl:annotatedTarget rdf:resource="http://www.w3.org/2002/07/owl#Class"/>-->
<!--<foo:ann>some annotation</foo:ann>-->
<!--</owl:Axiom>-->

<!-- http://ex.com/bar#Cls2 -->

<owl:Class rdf:about="http://ex.com/bar#Cls2"/>



<!-- http://ex.com/bar#ComplementCls -->

<owl:Class rdf:about="http://ex.com/bar#ComplementCls">
Expand All @@ -261,14 +245,10 @@
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#ComplementCls1 -->

<owl:Class rdf:about="http://ex.com/bar#ComplementCls1"/>



<!-- http://ex.com/bar#DataAllIntGT10 -->

<owl:Class rdf:about="http://ex.com/bar#DataAllIntGT10">
Expand All @@ -279,18 +259,16 @@
<rdfs:Datatype>
<owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:minInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">10</xsd:minInclusive>
</rdf:Description>
<rdfs:Datatype>
<xsd:minInclusive rdf:about="http://www.w3.org/2001/XMLSchema#integer">10</xsd:minInclusive>
</rdfs:Datatype>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:allValuesFrom>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#DataExact5Prop1 -->

<owl:Class rdf:about="http://ex.com/bar#DataExact5Prop1">
Expand All @@ -305,7 +283,6 @@
</owl:Class>



<!-- http://ex.com/bar#DataHasVal5 -->

<owl:Class rdf:about="http://ex.com/bar#DataHasVal5">
Expand All @@ -319,7 +296,18 @@
</owl:equivalentClass>
</owl:Class>

<!-- http://ex.com/bar#HasValProp1IndivB -->

<owl:Class rdf:about="http://ex.com/bar#HasValProp1IndivB">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1"/>
</owl:onProperty>
<owl:hasValue rdf:resource="http://ex.com/foo#indivB"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>

<!-- http://ex.com/bar#DataMax2Prop1 -->

Expand All @@ -335,8 +323,6 @@
<owl:disjointWith rdf:resource="http://ex.com/bar#DataMin3Prop1"/>
</owl:Class>



<!-- http://ex.com/bar#DataMin3Prop1 -->

<owl:Class rdf:about="http://ex.com/bar#DataMin3Prop1">
Expand All @@ -350,21 +336,21 @@
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#DataSomeIntLT20 -->

<owl:Class rdf:about="http://ex.com/bar#DataSomeIntLT20">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://ex.com/bar#dataProp2"/>
<owl:onProperty>
<owl:DatatypeProperty rdf:about="http://ex.com/bar#dataProp2"/>
</owl:onProperty>
<owl:someValuesFrom>
<rdfs:Datatype>
<owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:maxExclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">20</xsd:maxExclusive>
</rdf:Description>
<rdfs:Datatype>
<xsd:maxExclusive rdf:about="http://www.w3.org/2001/XMLSchema#integer">20</xsd:maxExclusive>
</rdfs:Datatype>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:someValuesFrom>
Expand All @@ -381,7 +367,9 @@
<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1"/>
</owl:onProperty>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">5</owl:qualifiedCardinality>
<owl:onClass rdf:resource="http://ex.com/bar#Cls1"/>
<owl:onClass>
<owl:Class rdf:about="http://ex.com/bar#Cls1"/>
</owl:onClass>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
Expand All @@ -392,27 +380,14 @@
<owl:Class rdf:about="http://ex.com/bar#HasSelfProp1">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://ex.com/bar#objProp1"/>
<owl:onProperty>
<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1"/>
</owl:onProperty>
<owl:hasSelf rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</owl:hasSelf>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#HasValProp1IndivB -->

<owl:Class rdf:about="http://ex.com/bar#HasValProp1IndivB">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://ex.com/bar#objProp1"/>
<owl:hasValue rdf:resource="http://ex.com/foo#indivB"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#IntersectionCls -->

<owl:Class rdf:about="http://ex.com/bar#IntersectionCls">
Expand All @@ -437,22 +412,27 @@
<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1"/>
</owl:onProperty>
<owl:maxQualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">3</owl:maxQualifiedCardinality>
<owl:onClass rdf:resource="http://ex.com/bar#Cls1"/>
<owl:onClass>
<owl:Class rdf:about="http://ex.com/bar#Cls1"/>
</owl:onClass>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#Min2Prop1Cls1 -->
<!--<owl:Class rdf:about="http://ex.com/bar#Min2Prop1Cls1"/>-->
<owl:Class rdf:about="http://ex.com/bar#Min2Prop1Cls1">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1"/>
</owl:onProperty>
<owl:minQualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">2</owl:minQualifiedCardinality>
<owl:onClass rdf:resource="http://ex.com/bar#Cls1"/>
<owl:onClass>
<owl:Class rdf:about="http://ex.com/bar#Cls1"/>
</owl:onClass>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
Expand All @@ -472,8 +452,6 @@
</owl:equivalentClass>
</owl:Class>



<!-- http://ex.com/bar#UnionCls -->

<owl:Class rdf:about="http://ex.com/bar#UnionCls">
Expand All @@ -495,7 +473,6 @@
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://ex.com/foo#indivA -->

<owl:NamedIndividual rdf:about="http://ex.com/foo#indivA">
<rdf:type rdf:resource="http://ex.com/bar#Cls1"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AllDifferent"/>
Expand All @@ -504,7 +481,7 @@
<rdf:Description rdf:about="http://ex.com/foo#indivB"/>
</owl:distinctMembers>
<owl:sameAs rdf:resource="http://ex.com/foo#sameAsIndivA"/>
<bar:objProp1 rdf:resource="http://ex.com/foo#indivB"/>
<bar:objProp1 rdf:about="http://ex.com/foo#indivB"/>
<bar:dataProp1>ABCD</bar:dataProp1>
</owl:NamedIndividual>

Expand Down
2 changes: 1 addition & 1 deletion sansa-owl-spark/src/test/resources/ont_functional.owl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ontology(<http://ex.com/ont/sample1.owl>
#Import(<http://www.example.com/my/2.0>)
# annotations
Annotation(foo:hasName "Name")
Annotation(bar:hasTitle "Title")
Annotation(bar:hasTitle "Title")
Annotation(:description "A longer
description running over
several lines")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OWLXMLSyntaxOWLAxiomsBuilderTest extends FunSuite with SharedSparkContext
}

test("The number of axioms should match") {
val expectedNumberOfAxioms = 93
val expectedNumberOfAxioms = 94
assert(rdd.count() == expectedNumberOfAxioms)
}

Expand Down Expand Up @@ -142,6 +142,7 @@ class OWLXMLSyntaxOWLAxiomsBuilderTest extends FunSuite with SharedSparkContext

val expectedNumberOfAxioms = 40
val filteredRDD = rdd.filter(axiom => axiom.isInstanceOf[OWLDeclarationAxiom])
filteredRDD.foreach(println(_))

assert(filteredRDD.count() == expectedNumberOfAxioms)
}
Expand Down Expand Up @@ -179,7 +180,7 @@ class OWLXMLSyntaxOWLAxiomsBuilderTest extends FunSuite with SharedSparkContext

val expectedNumberOfAxioms = 1
val filteredRDD = rdd.filter(axiom => axiom.isInstanceOf[OWLDisjointClassesAxiom])

filteredRDD.foreach(println(_))
assert(filteredRDD.count() == expectedNumberOfAxioms)
}

Expand All @@ -194,7 +195,6 @@ class OWLXMLSyntaxOWLAxiomsBuilderTest extends FunSuite with SharedSparkContext

val expectedNumberOfAxioms = 1
val filteredRDD = rdd.filter(axiom => axiom.isInstanceOf[OWLClassAssertionAxiom])

assert(filteredRDD.count() == expectedNumberOfAxioms)
}

Expand Down Expand Up @@ -477,21 +477,25 @@ class OWLXMLSyntaxOWLAxiomsBuilderTest extends FunSuite with SharedSparkContext

val expectedNumberOfAxioms = 2
val filteredRDD = rdd.filter(axiom => axiom.isInstanceOf[OWLEquivalentObjectPropertiesAxiom])

assert(filteredRDD.count() == expectedNumberOfAxioms)
}

test("The number of generated OWLInverseObjectPropertiesAxiom objects should be correct") {
/* <owl:ObjectProperty rdf:about="http://ex.com/bar#objProp1">
/* <owl:ObjectProperty rdf:about="http://ex.com/bar#invObjProp1">
<owl:inverseOf rdf:resource="http://ex.com/bar#objProp1"/>
<owl:equivalentProperty>
<rdf:Description>
<owl:inverseOf rdf:resource="http://ex.com/bar#objProp1"/>
</rdf:Description>
</owl:equivalentProperty>
</owl:ObjectProperty>
*/

// --> InverseObjectProperties(<http://ex.com/bar#invObjProp1> <http://ex.com/bar#objProp1>)
// --> InverseObjectProperties(ObjectInverseOf(<http://ex.com/bar#objProp1>) <http://ex.com/bar#objProp1>)

val expectedNumberOfAxioms = 1
val expectedNumberOfAxioms = 2
val filteredRDD = rdd.filter(axiom => axiom.isInstanceOf[OWLInverseObjectPropertiesAxiom])

assert(filteredRDD.count() == expectedNumberOfAxioms)
}

Expand Down

0 comments on commit 914e91c

Please sign in to comment.