Skip to main content

Import RDF graphs into ArangoDB

Project description

DEVELOPMENT VERSION - WIP - EXPECT BREAKING CHANGES


Arango-RDF

PyPI version badge Python versions badge

License Code style: black Downloads

Import/Export RDF graphs with ArangoDB

About RDF

RDF 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:

Installation

Latest Release

pip install arango-rdf

Current State

pip install git+https://github.com/ArangoDB-Community/ArangoRDF

Quickstart

from arango import ArangoClient
from arango_rdf import ArangoRDF

db = ArangoClient(hosts="http://localhost:8529").db("_system", username="root", password="")

adb_rdf = ArangoRDF(db, sub_graph="music")

config = {'normalize_literals': True} # {'normalize_literals': False}

# RDF Import
adb_rdf.init_rdf_collections(bnode="Blank")
adb_rdf.import_rdf("./examples/data/music_schema.ttl", format="ttl", config)
adb_rdf.import_rdf("./examples/data/beatles.ttl", format="ttl", config)

# RDF Export
adb_rdf.export(f"./examples/data/rdfExport.ttl", format="ttl")

# Re-import RDF Export
adb_rdf.import_rdf(f"./examples/data/rdfExport.ttl", format="ttl")

# Ontology Import
adb_rdf_2 = ArangoRDF(db, graph="ontology_iao")
adb_rdf_2.init_ontology_collections()
adb_rdf_2.import_ontology("./examples/data/iao.owl")

Development & Testing

  1. git clone https://github.com/ArangoDB-Community/ArangoRDF
  2. cd arango-rdf
  3. (create virtual environment of choice)
  4. pip install -e .[dev]
  5. (create an ArangoDB instance with method of choice)
  6. python tests/test.py (assumes username=root, password=openSesame)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arango_rdf-0.0.2.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

arango_rdf-0.0.2-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page