Code Monkey home page Code Monkey logo

rdf2gremlin's Introduction

rdf2gremlin

Build Status Coverage Status PyPI PyPI

It has never been easier to transform your RDF data into a property graph based on TinkerPop-Gremlin.

Introduction

Apache TinkerPop is a graph computing framework for both graph databases (OLTP) and graph analytic systems (OLAP). Gremlin is the graph traversal language of TinkerPop.

The Resource Description Framework (RDF) is a standard model for data interchange on the Web originally designed as a metadata data model. It has come to be used as a general method for conceptual description or modeling of information that is implemented in web resources, using a variety of syntax notations and data serialization formats. This linking structure forms a directed labeled graph, where the edges represent the named link between two resources, represented by the graph nodes. This graph view is the easiest possible mental model for RDF and is often used in easy-to-understand visual explanations. Resources are denoted by IRIs. The general convention is to use http URIs.

RDF graphs are queries using SPARQL language. SPARQL 1.1 is a set of specifications that provide languages and protocols to query and manipulate RDF graph content on the Web or in an RDF store.

This library, rdf2gremlin, provides an easy way to load the RDF data-sets into a property graph in order to benefit from the features of traversal language, which are not available in SPARQL pattern matching language.

Installation

# switch to your local virtual environment 
. ./venv/activate

pip install rdf2gremlin
# ... enjoy ...

Note: The library tornado shall satisfy tornado>=4.4.1,<5.0 version restriction inherited from the python_gremlin library.

Prerequisites

Gremlin-Python is designed to connect to a "server" that is hosting a TinkerPop-enabled graph system. That "server" could be Gremlin Server or a remote Gremlin provider that exposes protocols by which Gremlin-Python can connect. This requirement is inherited by the current library as well.

In order to use this library it is necessary to have a Gremlin service available locally or on a remote location. The easiest way is to run a TinkerProp server locally. This can be done by either: (a) downloading and running TinkerPop

wget https://archive.apache.org/dist/tinkerpop/3.4.3/apache-tinkerpop-gremlin-server-3.4.3-bin.zip
unzip apache-tinkerpop-gremlin-server-3.4.3-bin.zip
cd apache-tinkerpop-gremlin-server-3.4.3/
./bin/gremlin-server.sh start

# ... to stop the server ...

./bin/gremlin-server.sh stop

or (b) running it as a Docker container.

docker pull tinkerpop/gremlin-server
docker run --name gremlin-server -p 8182:8182 tinkerpop/gremlin-server

# ... to stop the server ...

docker stop gremlin-server

Getting started

Connect to a property graph service.

A typical connection to a server running on "localhost" that supports the Gremlin Server protocol using websockets from the Python shell looks like this:

from rdf2g import setup_graph

DEFAULT_LOCAL_CONNECTION_STRING = "ws://localhost:8182/gremlin"
g = setup_graph(DEFAULT_LOCAL_CONNECTION_STRING)

Once g has been created using a connection, it is then possible to start writing Gremlin traversals to query the remote graph.

Load a graph

Read an RDF graph.

import rdflib
import pathlib

OUTPUT_FILE_LAM_PROPERTIES = pathlib.Path("../resource/celex_project_properties_v2.ttl").resolve()

rdf_graph = rdflib.Graph()
rdf_graph.parse(str(OUTPUT_FILE_LAM_PROPERTIES), format="ttl")

Load the RDF graph into a property graph.

from rdf2g import load_rdf2g
load_rdf2g(g, rdf_graph)

The created property graph follows the following set of conventions.

  • URIs and Blank nodes are transformed into property graph nodes.
  • Predicates connecting an URI to another URI or a blank node are transformed into property graph edges. Edge labels correspond to qualified IRIs generated using the prefix definitions available in the RDF data-set.
  • Node labels correspond to qualified IRIs generated using the prefix definitions available in the RDF data-set.
  • RDF Litarals are transformed into values of the node properties, while the preceding predicates into keys of the node properties. In other words
  • Predicates connecting an URI to a RDF Literal are transformed into {key:value} pairs and added as node properties.
  • Nodes have a special property 'iri' that is equivalent to the absolute URI of the RDF resource.

Get a node

Get a node referring to it either by label, iri or id

skos_concept_iri = rdflib.URIRef("http://www.w3.org/2004/02/skos/core#Concept")
v1 = rdf2g.get_node(g, skos_concept_iri)

skos_concept_label = "skos:Concept"
v2 = rdf2g.get_node(g, skos_concept_label)

hypothetical_node_id = 880
v3 = rdf2g.get_node(g, hypothetical_node_id)

print (v1 == v2 == v3) # should be true

Get nodes by their supposed rdf:type. This concept is inherited, of course, from RDF world.

skos_concept_label = "skos:Concept"

list_of_concept = rdf2g.get_nodes_of_type(g, skos_concept_label)

# print the list of concepts in the graph
print (list_of_concept)

Generate a traversal tree

It is possible to traverse the property graph and then generate the traversal tree from it. This is especially useful when the graph serves as structured document content say JSON or XML serialisation.

To do that first, get two levels deep traversal tree and the edges between them for all the nodes in the graph that have iri == known_iri. Further please see the Gremlin reference documentation at Apache TinkerPop for more information on usage.

known_iri = 'http://publications.europa.eu/resources/authority/celex/md_CODE' 
s = g.V().has('iri', known_iri).outE().inV().tree().next()

Altenatively use the function rdf2g.generate_traversal_tree

node = rdf2g.get_node(self.g, known_iri)
s = rdf2g.generate_traversal_tree(self.g, node)

Then expand and simplify that tree. First, simplify the dict structure to simple Python types, removing the Gremlin objects. Second, expand by providing the properties for each visited node, while the edges are considered as special properties leading to a another node dictionary.

from pprint import pprint
result = rdf2g.expand_tree(g, s)
pprint (result)

The traversal tree nodes contain, in addition to original RDF content, two special properties @id and @label which correspond to the standard Gremlin id and label properties. The @ sign is used to distinguish the original RDF from the Gremlin features. Property graph edges, are reduced to keys in the final dict and for this reason they have no additional descriptions just like in the original RDF graph.

Contributing

You are more than welcome to help expand and mature this project.

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

License

This project is Licensed under the GPL v3 License - see LICENSE file

rdf2gremlin's People

Contributors

costezki avatar pidugusundeep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rdf2gremlin's Issues

list in list, generated by rdf2g.expand_tree, shall be flattened

check, when there is a list in the list generated by the rdf2g.expand_tree.

Usually, there shall be a single element in the outer list, if there are more, then multiple tree roots were provided otherwise it is bad.

Return the inner list only by returning the only element in the outer list. If outer list has more than one element, leave it as is.

warning on initializing gremlin graph

/home/lps/work/workspace-charm/rdf2gremlin/venv/lib/python3.7/site-packages/gremlin_python/structure/graph.py:35:

DeprecationWarning: As of release 3.3.5, replaced by the gremlin_python.process.anonymous_traversal.traversal() function.

Can't split URI

So I fired up Janus graph and attempted to load some RDF data. However, I get an error.

Any guidance or help would be appreciated

The error from the run

 (gremlin)  fils@xps  ~/src/Projects/ResearchItems/JanusGraph  python loader.py
2020-05-14 12:04:40,528 [INFO] Successfully connected to the graph server
Traceback (most recent call last):
  File "loader.py", line 16, in <module>
    load_rdf2g(g, rdf_graph)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdf2g/update.py", line 30, in load_rdf2g
    subj_node = create_node(g, s, rdf_graph)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdf2g/update.py", line 69, in create_node
    label = rdf_graph.qname(rdf_term) if rdf_graph.qname(rdf_term) else str(rdf_term)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdflib/graph.py", line 904, in qname
    return self.namespace_manager.qname(uri)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdflib/namespace.py", line 294, in qname
    prefix, namespace, name = self.compute_qname(uri)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdflib/namespace.py", line 330, in compute_qname
    namespace, name = split_uri(uri)
  File "/home/fils/src/python/venvs/gremlin/lib/python3.6/site-packages/rdflib/namespace.py", line 502, in split_uri
    raise Exception("Can't split '%s'" % uri)
Exception: Can't split 'N80115c7e6093451a80be8ce53a2abbb4'

from janusgraph

...
389771 [gremlin-server-exec-7] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0)]. For better performance, use indexes
389789 [gremlin-server-exec-1] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0)]. For better performance, use indexes
389796 [gremlin-server-exec-2] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://sample.igsn.org/soilarchive/CDS-NSW)]. For better performance, use indexes
389812 [gremlin-server-exec-4] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60)]. For better performance, use indexes
389829 [gremlin-server-exec-6] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60)]. For better performance, use indexes
389835 [gremlin-server-exec-7] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = http://samples.earth/doc/bqs2dmqu6s73o70jds60)]. For better performance, use indexes
389860 [gremlin-server-exec-2] WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(iri = N80115c7e6093451a80be8ce53a2abbb4)]. For better performance, use indexes

the code

from rdf2g import setup_graph
import rdflib
import pathlib
from rdf2g import load_rdf2g


DEFAULT_LOCAL_CONNECTION_STRING = "ws://localhost:8182/gremlin"
g = setup_graph(DEFAULT_LOCAL_CONNECTION_STRING)


OUTPUT_FILE_LAM_PROPERTIES = pathlib.Path("./test.nq").resolve()

rdf_graph = rdflib.Graph()
rdf_graph.parse(str(OUTPUT_FILE_LAM_PROPERTIES), format="nquads")

load_rdf2g(g, rdf_graph)

the test nq

<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://purl.org/dc/terms/title> "ANZ soil sample bqs2dj2u6s73o70jcpr0" .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/PhysicalSample> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/soil> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/creator> <http://sample.igsn.org/soilarchive/CDS-NSW> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/dateCreated> "1970-07-21T05:03:19-05:00"^^<http://www.w3.org/2001/XMLSchema#date> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/description> "assumenda eum velit ea molestias quia explicabo! possimus cum quam ea qui saepe quaerat. assumenda autem qui omnis in. minima impedit rerum dolorum ullam eos nemo. quidem laudantium quo. ipsam et saepe rerum voluptas perferendis. iste unde maiores magni occaecati. cumque magnam suscipit. facere ipsa iusto magni doloremque iste. qui qui dolorem ea numquam quia alias voluptatem." .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/spatialCoverage> _:bbqs2gpqu6s78kvjb1ee0 .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/title> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://schema.org/url> <http://samples.earth/id/do/bqs2dj2u6s73o70jcpr0> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/sosa/Sample> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/2000/01/rdf-schema#label> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/ns/dcat#landingPage> <http://samples.earth/doc/bqs2dj2u6s73o70jcpr0> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/ns/sosa/isResultOf> _:bbqs2gpqu6s78kvjb1eeg .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soil/soil_199.CAN.C410> .
<http://sample.igsn.org/soilarchive/bqs2dj2u6s73o70jcpr0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soilhorizon/soil_horizon_199.CAN.C410.1.2> .
_:bbqs2gpqu6s78kvjb1ee0 <http://schema.org/geo> _:bbqs2gpqu6s78kvjb1ef0 .
_:bbqs2gpqu6s78kvjb1ee0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> .
_:bbqs2gpqu6s78kvjb1ef0 <http://schema.org/latitude> "23"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1ef0 <http://schema.org/longitude> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1ef0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://purl.org/dc/terms/title> "ANZ soil sample bqs2dniu6s73o70je5g0" .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/PhysicalSample> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/soil> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/creator> <http://sample.igsn.org/soilarchive/CDS-NSW> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/dateCreated> "1985-07-23T08:58:03-05:00"^^<http://www.w3.org/2001/XMLSchema#date> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/description> "atque id perspiciatis sapiente voluptatem velit ullam velit earum." .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/spatialCoverage> _:bbqs2gpqu6s78kvjb1e80 .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/title> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://schema.org/url> <http://samples.earth/id/do/bqs2dniu6s73o70je5g0> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/sosa/Sample> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/2000/01/rdf-schema#label> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/ns/dcat#landingPage> <http://samples.earth/doc/bqs2dniu6s73o70je5g0> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/ns/sosa/isResultOf> _:bbqs2gpqu6s78kvjb1e8g .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soil/soil_199.CAN.C410> .
<http://sample.igsn.org/soilarchive/bqs2dniu6s73o70je5g0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soilhorizon/soil_horizon_199.CAN.C410.1.2> .
_:bbqs2gpqu6s78kvjb1e80 <http://schema.org/geo> _:bbqs2gpqu6s78kvjb1e90 .
_:bbqs2gpqu6s78kvjb1e80 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> .
_:bbqs2gpqu6s78kvjb1e90 <http://schema.org/latitude> "83"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1e90 <http://schema.org/longitude> "-178"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1e90 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://purl.org/dc/terms/title> "ANZ soil sample bqs2dhqu6s73o70jcdg0" .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/PhysicalSample> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/soil> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/creator> <http://sample.igsn.org/soilarchive/CDS-NSW> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/dateCreated> "1997-08-17T07:18:08-05:00"^^<http://www.w3.org/2001/XMLSchema#date> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/description> "voluptatibus et totam voluptate voluptatem. et voluptas quidem quo. voluptatum aliquam aliquid ad. hic accusamus dolor. repellat vitae rerum rem et est labore. praesentium dolorum numquam voluptas. minima expedita quia quia ut rerum corporis amet rem tempore. facere quisquam quo in fuga sunt eos quam." .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/spatialCoverage> _:bbqs2gpqu6s78kvjb1elg .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/title> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://schema.org/url> <http://samples.earth/id/do/bqs2dhqu6s73o70jcdg0> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/sosa/Sample> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/2000/01/rdf-schema#label> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/ns/dcat#landingPage> <http://samples.earth/doc/bqs2dhqu6s73o70jcdg0> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/ns/sosa/isResultOf> _:bbqs2gpqu6s78kvjb1em0 .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soil/soil_199.CAN.C410> .
<http://sample.igsn.org/soilarchive/bqs2dhqu6s73o70jcdg0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soilhorizon/soil_horizon_199.CAN.C410.1.2> .
_:bbqs2gpqu6s78kvjb1elg <http://schema.org/geo> _:bbqs2gpqu6s78kvjb1emg .
_:bbqs2gpqu6s78kvjb1elg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> .
_:bbqs2gpqu6s78kvjb1emg <http://schema.org/latitude> "-13"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1emg <http://schema.org/longitude> "-137"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1emg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://purl.org/dc/terms/title> "ANZ soil sample bqs2dmqu6s73o70jds60" .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/PhysicalSample> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/soil> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/creator> <http://sample.igsn.org/soilarchive/CDS-NSW> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/dateCreated> "2003-03-18T02:42:35-06:00"^^<http://www.w3.org/2001/XMLSchema#date> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/description> "hic atque tempore sint animi." .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/spatialCoverage> _:bbqs2gpqu6s78kvjb1efg .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/title> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://schema.org/url> <http://samples.earth/id/do/bqs2dmqu6s73o70jds60> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/sosa/Sample> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/2000/01/rdf-schema#label> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/ns/dcat#landingPage> <http://samples.earth/doc/bqs2dmqu6s73o70jds60> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/ns/sosa/isResultOf> _:bbqs2gpqu6s78kvjb1eg0 .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soil/soil_199.CAN.C410> .
<http://sample.igsn.org/soilarchive/bqs2dmqu6s73o70jds60> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soilhorizon/soil_horizon_199.CAN.C410.1.2> .
_:bbqs2gpqu6s78kvjb1efg <http://schema.org/geo> _:bbqs2gpqu6s78kvjb1egg .
_:bbqs2gpqu6s78kvjb1efg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> .
_:bbqs2gpqu6s78kvjb1egg <http://schema.org/latitude> "26"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1egg <http://schema.org/longitude> "-33"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:bbqs2gpqu6s78kvjb1egg <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/GeoCoordinates> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://purl.org/dc/terms/title> "ANZ soil sample bqs2dsqu6s73o70jfjb0" .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/PhysicalSample> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/additionalType> <http://pid.geoscience.gov.au/def/voc/igsn-codelists/soil> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/creator> <http://sample.igsn.org/soilarchive/CDS-NSW> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/dateCreated> "2005-08-02T09:18:28-05:00"^^<http://www.w3.org/2001/XMLSchema#date> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/description> "nesciunt et iste nisi atque et. consequatur enim dicta neque. vel error quos voluptatem in sit facere quo tenetur deserunt. voluptas tenetur architecto minus esse quam. sed dolorem nobis magnam. est culpa non placeat." .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/spatialCoverage> _:bbqs2gpqu6s78kvjb1e9g .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/title> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://schema.org/url> <http://samples.earth/id/do/bqs2dsqu6s73o70jfjb0> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/sosa/Sample> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/2000/01/rdf-schema#label> "ANZ soil sample" .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/ns/dcat#landingPage> <http://samples.earth/doc/bqs2dsqu6s73o70jfjb0> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/ns/sosa/isResultOf> _:bbqs2gpqu6s78kvjb1ea0 .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soil/soil_199.CAN.C410> .
<http://sample.igsn.org/soilarchive/bqs2dsqu6s73o70jfjb0> <http://www.w3.org/ns/sosa/isSampleOf> <http://www.anzsoil.org/data/csiro-natsoil/anzsoilml201/soilhorizon/soil_horizon_199.CAN.C410.1.2> .

install bug, incorrect dependecy

Collecting rdf2gremlin
Using cached https://files.pythonhosted.org/packages/10/33/5d501fc015e32c101ed7687bd924a4566e580a7a034293117462da14844c/rdf2gremlin-0.1.34.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pycharm-packaging/rdf2gremlin/setup.py", line 8, in
import rdf2g
File "/tmp/pycharm-packaging/rdf2gremlin/rdf2g/init.py", line 8, in
from rdf2g.update import *
File "/tmp/pycharm-packaging/rdf2gremlin/rdf2g/update.py", line 12, in
from gremlin_python import statics
ModuleNotFoundError: No module named 'gremlin_python'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging/rdf2gremlin/

Write to file?

So I was very happy to find this as I need to load RDF into Janus graph.

However, while I can get it to load directly into Janus graph, was curious if there was a way to write the commands to file? In our workflow it might be nice to be able to stage the writes to Minio (s3 store) and then just feed them into Janus graph.

Not a big deal, but if there is a way to do this I'd love to know it...

Add node for every node

Hi there!

Thanks for this amazing lib.

I'd like to know if it's possible to add a new node and vertex to every node.

I'm loading a ttl and inserting with the load function to my graph database.

Leo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.