Package: arango-rdf
ArangoRDFConvert RDF Graphs to ArangoDB, and vice-versa.About RDFRDF is a standard model for data interchange on the Web. RDF has features that facilitate data merging even if the underlying schemas differ, and it specifically supports the evolution of schemas over time without requiring all the data consumers to be changed.RDF extends the linking structure of the Web to use URIs to name the relationship between things as well as the two ends of the link (this is usually referred to as a "triple"). Using this simple model, it allows structured and semi-structured data to be mixed, exposed, and shared across different applications.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 to get started:RDF PrimerRDFLib (Python)One Example for Modeling RDF as ArangoDB GraphsInstallationLatest Releasepip install arango-rdfCurrent Statepip install git+https://github.com/ArangoDB-Community/ArangoRDFQuickstartfromrdflibimportGraphfromarangoimportArangoClientfromarango_rdfimportArangoRDFdb=ArangoClient().db()adbrdf=ArangoRDF(db)defbeatles():g=Graph()g.parse("https://raw.githubusercontent.com/ArangoDB-Community/ArangoRDF/main/tests/data/rdf/beatles.ttl",format="ttl")returngRDF to ArangoDBNote: RDF-to-ArangoDB functionality has been implemented using concepts described in the paperTransforming RDF-star to Property Graphs: A Preliminary Analysis of Transformation Approaches. So we offer two transformation approaches:RDF-Topology Preserving Transformation (RPT)Property Graph Transformation (PGT)# 1. RDF-Topology Preserving Transformation (RPT)adbrdf.rdf_to_arangodb_by_rpt(name="BeatlesRPT",rdf_graph=beatles(),overwrite_graph=True)# 2. Property Graph Transformation (PGT)adbrdf.rdf_to_arangodb_by_pgt(name="BeatlesPGT",rdf_graph=beatles(),overwrite_graph=True)ArangoDB to RDF# pip install arango-datasetsfromarango_datasetsimportDatasetsname="OPEN_INTELLIGENCE_ANGOLA"Datasets(db).load(name)# 1. Graph to RDFrdf_graph=adbrdf.arangodb_graph_to_rdf(name,rdf_graph=Graph())# 2. Collections to RDFrdf_graph_2=adbrdf.arangodb_collections_to_rdf(name,rdf_graph=Graph(),v_cols={"Event","Actor","Source"},e_cols={"eventActor","hasSource"},)# 3. Metagraph to RDFrdf_graph_3=adbrdf.arangodb_to_rdf(name=name,rdf_graph=Graph(),metagraph={"vertexCollections":{"Event":{"date","description","fatalities"},"Actor":{"name"}},"edgeCollections":{"eventActor":{}},},)Development & Testinggit clone https://github.com/ArangoDB-Community/ArangoRDFcd arango-rdf(create virtual environment of choice)pip install -e .[dev](create an ArangoDB instance with method of choice)pytest --url <> --dbName <> --username <> --password <>Note: Apytestparameter can be omitted if the endpoint is using its default value:defpytest_addoption(parser):parser.addoption("--url",action="store",default="http://localhost:8529")parser.addoption("--dbName",action="store",default="_system")parser.addoption("--username",action="store",default="root")parser.addoption("--password",action="store",default="")