Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/test/java/fr/inria/corese/core/load/OwlImportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testRdfImportDisabled() throws LoadException {
@Test
public void testRdfImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.rdf", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -58,7 +58,7 @@ public void testTurtleImportDisabled() throws LoadException {
@Test
public void testTurtleImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.ttl", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -76,7 +76,7 @@ public void testTrigImportDisabled() throws LoadException {
@Test
public void testTrigImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.trig", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -94,7 +94,7 @@ public void testNTriplesImportDisabled() throws LoadException {
@Test
public void testNTriplesImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.nt", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -112,7 +112,7 @@ public void testNQuadsImportDisabled() throws LoadException {
@Test
public void testNQuadsImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.nq", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -130,7 +130,7 @@ public void testJsonLdImportDisabled() throws LoadException {
@Test
public void testJsonLdImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.jsonld", true);
assertEquals(628, graphSize);
assertEquals(8, graphSize);
}

/**
Expand All @@ -139,7 +139,7 @@ public void testJsonLdImportEnabled() throws LoadException {
@Test
public void testRdfaImportDisabled() throws LoadException {
int graphSize = testImport("test_owl_import.html", false);
assertEquals(8, graphSize);
assertEquals(7, graphSize);
}

/**
Expand All @@ -148,7 +148,7 @@ public void testRdfaImportDisabled() throws LoadException {
@Test
public void testRdfaImportEnabled() throws LoadException {
int graphSize = testImport("test_owl_import.html", true);
assertEquals(628, graphSize);
assertEquals(7, graphSize);
}

/**
Expand All @@ -171,4 +171,4 @@ private int testImport(String fileName, boolean enableImport) throws LoadExcepti
loader.parse(resourcePath);
return graph.size();
}
}
}
23 changes: 11 additions & 12 deletions src/test/resources/data-test/owl_imports/test_owl_import.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<!DOCTYPE html>
<html
prefix="rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# owl: http://www.w3.org/2002/07/owl# rdfs: http://www.w3.org/2000/01/rdf-schema# foaf: http://xmlns.com/foaf/0.1/">
prefix="rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# owl: http://www.w3.org/2002/07/owl# rdfs: http://www.w3.org/2000/01/rdf-schema#">

<head>
<title>RDFa Example</title>
</head>

<body>
<div about="http://example.org/ontology" typeof="owl:Ontology">
<link property="owl:imports" href="http://xmlns.com/foaf/0.1/" />
</div>
<div about="http://example.org/ontology" typeof="owl:Ontology">
<link property="owl:imports" href="https://ns.inria.fr/sparql-extension/" />
</div>

<div about="http://example.org/ontology#Person" typeof="owl:Class">
<span property="rdfs:label">Person</span>
<link property="rdfs:subClassOf" href="http://xmlns.com/foaf/0.1/Person" />
</div>
<div about="http://example.org/ontology#Person" typeof="owl:Class">
<link property="rdfs:subClassOf" href="https://ns.inria.fr/sparql-extension#Extension" />
</div>

<div about="http://example.org/ontology#Student" typeof="owl:Class">
<span property="rdfs:label">Student</span>
<link property="rdfs:subClassOf" href="http://example.org/ontology#Person" />
</div>
<div about="http://example.org/ontology#Student" typeof="owl:Class">
<span property="rdfs:label">Student</span>
<link property="rdfs:subClassOf" href="http://example.org/ontology#Person" />
</div>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"owl": "http://www.w3.org/2002/07/owl#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"foaf": "http://xmlns.com/foaf/0.1/"
"rdfs": "http://www.w3.org/2000/01/rdf-schema#"
},
"@graph": [
{
"@id": "http://example.org/ontology",
"@type": "owl:Ontology",
"owl:imports": {
"@id": "http://xmlns.com/foaf/0.1/"
"@id": "https://ns.inria.fr/sparql-extension/"
}
},
{
"@id": "http://example.org/ontology#Person",
"@type": "owl:Class",
"rdfs:label": "Person",
"rdfs:subClassOf": {
"@id": "http://xmlns.com/foaf/0.1/Person"
"@id": "https://ns.inria.fr/sparql-extension#Extension"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/data-test/owl_imports/test_owl_import.nq
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<http://example.org/ontology> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> <http://example.org/ontology> .
<http://example.org/ontology> <http://www.w3.org/2002/07/owl#imports> <http://xmlns.com/foaf/0.1/> <http://example.org/ontology> .
<http://example.org/ontology> <http://www.w3.org/2002/07/owl#imports> <https://ns.inria.fr/sparql-extension#> <http://example.org/ontology> .
<http://example.org/ontology#Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> <http://example.org/ontology> .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#label> "Person" <http://example.org/ontology> .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://xmlns.com/foaf/0.1/Person> <http://example.org/ontology> .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <https://ns.inria.fr/sparql-extension#Extension> <http://example.org/ontology> .
<http://example.org/ontology#Student> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> <http://example.org/ontology> .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#label> "Student" <http://example.org/ontology> .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://example.org/ontology#Person> <http://example.org/ontology> .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://example.org/ontology#Person> <http://example.org/ontology> .
6 changes: 3 additions & 3 deletions src/test/resources/data-test/owl_imports/test_owl_import.nt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<http://example.org/ontology> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .
<http://example.org/ontology> <http://www.w3.org/2002/07/owl#imports> <http://xmlns.com/foaf/0.1/> .
<http://example.org/ontology> <http://www.w3.org/2002/07/owl#imports> <https://ns.inria.fr/sparql-extension#> .
<http://example.org/ontology#Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#label> "Person" .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://xmlns.com/foaf/0.1/Person> .
<http://example.org/ontology#Person> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <https://ns.inria.fr/sparql-extension#Extension> .
<http://example.org/ontology#Student> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#label> "Student" .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://example.org/ontology#Person> .
<http://example.org/ontology#Student> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://example.org/ontology#Person> .
4 changes: 2 additions & 2 deletions src/test/resources/data-test/owl_imports/test_owl_import.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<owl:Ontology rdf:about="http://example.org/ontology">
<owl:imports rdf:resource="http://xmlns.com/foaf/0.1/" />
<owl:imports rdf:resource="https://ns.inria.fr/sparql-extension/" />
</owl:Ontology>

<owl:Class rdf:about="http://example.org/ontology#Person">
<rdfs:label>Person</rdfs:label>
<rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Person" />
<rdfs:subClassOf rdf:resource="https://ns.inria.fr/sparql-extension#Extension" />
</owl:Class>

<owl:Class rdf:about="http://example.org/ontology#Student">
Expand Down
7 changes: 3 additions & 4 deletions src/test/resources/data-test/owl_imports/test_owl_import.trig
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://example.org/ontology> {
<http://example.org/ontology> a owl:Ontology ;
owl:imports <http://xmlns.com/foaf/0.1/> .
owl:imports <https://ns.inria.fr/sparql-extension/> .

:Person a owl:Class ;
rdfs:label "Person" ;
rdfs:subClassOf foaf:Person .
rdfs:subClassOf <https://ns.inria.fr/sparql-extension#Extension> .

:Student a owl:Class ;
rdfs:label "Student" ;
rdfs:subClassOf :Person .
}
}
8 changes: 3 additions & 5 deletions src/test/resources/data-test/owl_imports/test_owl_import.ttl
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
@prefix : <http://example.org/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://example.org/ontology> a owl:Ontology ;
owl:imports <http://xmlns.com/foaf/0.1/> .
owl:imports <https://ns.inria.fr/sparql-extension/> .

:Person a owl:Class ;
rdfs:label "Person" ;
rdfs:subClassOf foaf:Person .
rdfs:subClassOf rdfs:Resource .

:Student a owl:Class ;
rdfs:label "Student" ;
rdfs:subClassOf :Person .
rdfs:subClassOf :Person .