Requires neo4j plugins: APOC, NEOSEMANTICS.
In order to import RDF file, user also needs uniqueness constraint on Resource label (query in example below) and graph configuration initialized at least with default values (query in example below)
For additional RDF / ontology functions see neosemantics documentations.
Example of RDF import
<!DOCTYPE etl SYSTEM
"https://scriptella.org/dtd/etl.dtd"
>
<etl>
<description>Load RDF file into Neo4j</description>
<connection id=
"neo4j"
driver=
"neo4j"
url=
"bolt://localhost:7687"
user=
"neo4j"
password=
"admin"
/>
<!--Uncomment,
if
this
CONSTRAINT is missing
<script connection-id=
"neo4j"
>
CREATE CONSTRAINT n10s_unique_uri ON (r:Resource) ASSERT r.uri IS UNIQUE;
</script>
-->
<!-- Uncomment,
if
gragh config is missing
<script connection-id=
"neo4j"
>
CALL n10s.graphconfig.init();
</script>
-->
<script connection-id=
"neo4j"
>
CALL n10s.rdf.
import
.fetch(
"file:///var/lib/neo4j/import/1/7269659692861276924/file-to-process.owl"
,
"RDF/XML"
)
</script>
</etl>