Skip to content

opencitations/oc_ocdm

Repository files navigation

oc_ocdm

Run tests Coverage Documentation REUSE License: ISC PyPI version DOI

Python library for creating, manipulating, and exporting RDF data compliant with the OpenCitations Data Model. It handles OCDM entities (bibliographic resources, agents, identifiers, etc.) without requiring direct knowledge of RDF or SPARQL.

Quick start

pip install oc_ocdm
from oc_ocdm.graph import GraphSet
from oc_ocdm import Storer

g_set = GraphSet("https://w3id.org/oc/meta/")
br = g_set.add_br("https://w3id.org/oc/meta/prov/pa/1")
br.has_title("OpenCitations Meta")
br.create_journal_article()

doi = g_set.add_id("https://w3id.org/oc/meta/prov/pa/1")
doi.create_doi("10.1162/qss_a_00292")
br.has_identifier(doi)

storer = Storer(g_set)
storer.store_graphs_in_file("output.jsonld")

For guides, API reference, and examples, see the documentation.

About

Object mapping library for manipulating RDF graphs that are compliant with the OpenCitations datamodel.

Topics

Resources

License

Stars

Watchers

Forks

Contributors