@@ -236,6 +236,22 @@ public class OntoProceduresTest {
236
236
" owl:allValuesFrom :Animal\n " +
237
237
" ] ." ;
238
238
239
+ String restrictionsOnResourcesImplicitClassTurtle = "" +
240
+ "@prefix : <http://www.semanticweb.org/jb/ontologies/2021/5/untitled-ontology-2#> .\n " +
241
+ "@prefix owl: <http://www.w3.org/2002/07/owl#> .\n " +
242
+ "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n " +
243
+ "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n " +
244
+ "@base <http://www.semanticweb.org/jb/ontologies/2021/5/untitled-ontology-2> .\n " +
245
+ "\n " +
246
+ "\n " +
247
+ ":Parent owl:equivalentClass [ rdf:type owl:Restriction ;\n " +
248
+ " owl:onProperty :hasChild ;\n " +
249
+ " owl:someValuesFrom :Person\n " +
250
+ " ] ;\n " +
251
+ " rdfs:subClassOf [ rdf:type owl:Restriction ;\n " +
252
+ " owl:onProperty :hasPet ;\n " +
253
+ " owl:allValuesFrom :Animal\n " +
254
+ " ] ." ;
239
255
240
256
String restrictionsWithDomAndRange = "" +
241
257
"@prefix : <http://www.semanticweb.org/jb/ontologies/2021/5/untitled-ontology-2#> .\n " +
@@ -1143,7 +1159,7 @@ public void ontoSnippetImportRestrictions() throws Exception {
1143
1159
1144
1160
Record next = importResults .next ();
1145
1161
1146
- assertEquals (7L , next .get ("triplesLoaded" ).asLong ());
1162
+ assertEquals (9L , next .get ("triplesLoaded" ).asLong ());
1147
1163
1148
1164
assertEquals (9L , next .get ("triplesParsed" ).asLong ());
1149
1165
@@ -1183,7 +1199,7 @@ public void ontoSnippetImportRestrictions() throws Exception {
1183
1199
1184
1200
next = importResults .next ();
1185
1201
1186
- assertEquals (7L , next .get ("triplesLoaded" ).asLong ());
1202
+ assertEquals (9L , next .get ("triplesLoaded" ).asLong ());
1187
1203
1188
1204
assertEquals (9L , next .get ("triplesParsed" ).asLong ());
1189
1205
@@ -1217,6 +1233,29 @@ public void ontoSnippetImportRestrictions() throws Exception {
1217
1233
1218
1234
}
1219
1235
1236
+ @ Test
1237
+ public void ontoSnippetImportRestrictionsImplicitClass () throws Exception {
1238
+ try (Driver driver = GraphDatabase .driver (neo4j .boltURI (),
1239
+ Config .builder ().withoutEncryption ().build ())) {
1240
+
1241
+ initialiseGraphDB (neo4j .defaultDatabaseService (),
1242
+ "{ handleVocabUris: 'IGNORE' }" );
1243
+ Session session = driver .session ();
1244
+
1245
+ Map <String , Object > params = new HashMap <>();
1246
+ params .put ("rdf" , this .restrictionsOnResourcesImplicitClassTurtle );
1247
+
1248
+ Result importResults = session
1249
+ .run ("CALL n10s.onto.import.inline($rdf,'Turtle')" , params );
1250
+
1251
+ Record next = importResults .next ();
1252
+
1253
+ assertEquals (8L , next .get ("triplesLoaded" ).asLong ());
1254
+
1255
+ assertEquals (8L , next .get ("triplesParsed" ).asLong ());
1256
+ }
1257
+ }
1258
+
1220
1259
private void initialiseGraphDB (GraphDatabaseService db , String graphConfigParams ) {
1221
1260
db .executeTransactionally ("CREATE CONSTRAINT n10s_unique_uri "
1222
1261
+ "ON (r:Resource) ASSERT r.uri IS UNIQUE" );
0 commit comments