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_rdf import ArangoRDF

# RDF Import
adb_rdf = ArangoRDF(host="http://localhost:8529", username="root", password="openSesame", database="rdf", graph="rdf_music")
adb_rdf.init_rdf_collections(bnode="Blank")
adb_rdf.import_rdf("./examples/data/music_schema.ttl", format="ttl")
adb_rdf.import_rdf("./examples/data/beatles.ttl", format="ttl")

# 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("http://localhost:8529", "root", "openSesame", "ontologyImport", "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.1.dev0.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

arango_rdf-0.0.1.dev0-py3-none-any.whl (11.1 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