oc_ocdm

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

https://github.com/opencitations/oc_ocdm

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: springer.com, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

graphs object-mapping rdf sparql
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: opencitations
  • License: isc
  • Language: Python
  • Default Branch: master
  • Homepage: https://opencitations.net/
  • Size: 134 MB
Statistics
  • Stars: 6
  • Watchers: 4
  • Forks: 3
  • Open Issues: 20
  • Releases: 23
Topics
graphs object-mapping rdf sparql
Created about 5 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

oc_ocdm

Run tests Coverage Documentation Status PyPI version PyPI

DOI License: ISC

Documentation can be found here: https://oc-ocdm.readthedocs.io.

oc_ocdm is a Python ≥3.7 library that enables the user to import, produce, modify and export RDF data structures which are compliant with the OCDM v2.0.1 specification.

User's guide

This package can be simply installed with pip: bash pip install oc_ocdm Please, have a look at the notebooks available here.

Developer's guide

First steps

  1. Install Poetry: bash pip install poetry
  2. Clone this repository: bash git clone https://github.com/opencitations/oc_ocdm cd ./oc_ocdm
  3. Install all the dependencies: bash poetry install
  4. Build the package (output dir: dist): bash poetry build
  5. Globally install the package (alternatively, you can also install it inside a virtual-env, by providing the full path to the .tar.gz archive): bash pip install ./dist/oc_ocdm-<VERSION>.tar.gz
  6. If everything went the right way, than you should be able to use the oc_ocdm library in your Python modules as follows: python from oc_ocdm.graph import GraphSet from oc_ocdm.graph.entities.bibliographic import AgentRole # ...

How to run the tests

The project uses Virtuoso triplestore running in Docker for testing. Follow these steps to run the tests:

Prerequisites

  • Docker installed and running
  • All dependencies installed: bash poetry install

Basic test execution

On Linux/macOS: ``` bash # Start the test database ./tests/start-test-database.sh

# Run tests with coverage
poetry run coverage run --rcfile=tests/coverage/.coveragerc

# Stop the test database
./tests/stop-test-database.sh

```

On Windows (PowerShell): ``` powershell # Start the test database .\tests\start-test-database.ps1

# Run tests with coverage
poetry run coverage run --rcfile=tests/coverage/.coveragerc

# Stop the test database
.\tests\stop-test-database.ps1

```

How to manage the project using Poetry

See Poetry commands documentation.

AAA: when adding a non-dev dependency via poetry add, always remember to add that same dependency to the autodoc_mock_imports list in docs/source/conf.py (otherwise "Read the Docs" won't be able to compile the documentation correctly!).

How to publish the package onto Pypi

bash poetry publish --build

Install dependencies needed for the documentation

bash pip install Sphinx sphinx_rtd_theme

How to generate the documentation

bash rm ./docs/source/modules/* sphinx-apidoc -o ./docs/source/modules oc_ocdm *test*

How to build the documentation


Warning! In order to avoid getting the following WARNING: html_static_path entry '_static' does not exist, you'll need to manually create an empty _static folder with the command: bash mkdir docs/source/_static


  1. Always remember to move inside the docs folder: bash cd docs
  2. Use the Makefile provided to build the docs:
    • on Windows make.bat html
    • on Linux and MacOs make html
  3. Open the build/html/index.html file with a web browser of your choice!

Citation

If you are using or extending oc_ocdm as part of a scientific publication, we would appreciate a citation of our article.

bibtex @inproceedings{persiani2022programming, title={{A} {P}rogramming {I}nterface for {C}reating {D}ata {A}ccording to the {SPAR} {O}ntologies and the {O}pen{C}itations {D}ata {M}odel}, author={Persiani, Simone and Daquino, Marilena and Peroni, Silvio}, booktitle={The Semantic Web: 19th International Conference, ESWC 2022, Hersonissos, Crete, Greece, May 29--June 2, 2022, Proceedings}, pages={305--322}, year={2022}, organization={Springer} }

Acknowledgements

This work has been funded by the project "Open Biomedical Citations in Context Corpus" (Wellcome Trust, Grant n. 214471/Z/18/Z) and the project "Wikipedia Citations in Wikidata" (Wikimedia Foundation, https://meta.wikimedia.org/wiki/Wikicite/grant/WikipediaCitationsin_Wikidata).

We would like to thank (in alphabetic order) Fabio Mariani (@FabioMariani), Arcangelo Massari (@arcangelo7), and Gabriele Pisciotta (@GabrielePisciotta) for the constructive feedback.

Owner

  • Name: OpenCitations
  • Login: opencitations
  • Kind: organization
  • Email: contact@opencitations.net
  • Location: Bologna, Italy

OpenCitations is an independent infrastructure organization for open scholarship dedicated to the publication of open bibliographic and citation data.

Citation (CITATION.cff)

cff-version: 1.2.0
title: oc_ocdm
message: >-
  If you are using or extending oc_ocdm as part of a scientific
  publication, we would appreciate a citation of our article.
type: software
authors:
  - given-names: Simone
    family-names: Persiani
  - given-names: Marilena
    family-names: Daquino
    orcid: 'https://orcid.org/0000-0002-1113-7550'
  - given-names: Silvio
    family-names: Peroni
    orcid: 'https://orcid.org/0000-0003-0530-4305'
doi: 10.5281/zenodo.5770646
url: "https://opencitations.net/"
repository-code: 'https://github.com/opencitations/oc_ocdm'
license: ISC
preferred-citation:
  type: conference-paper
  authors:
  - family-names: "Simone"
    given-names: "Persiani"
  - family-names: "Marilena"
    given-names: "Daquino"
    orcid: 'https://orcid.org/0000-0002-1113-7550'
  - family-names: "Silvio"
    given-names: "Peroni"
    orcid: 'https://orcid.org/0000-0003-0530-4305'
  doi: "10.1007/978-3-031-06981-9_18"
  collection-title: "The Semantic Web: 19th International Conference, ESWC 2022, Hersonissos, Crete, Greece, May 29--June 2, 2022, Proceedings"
  collection-type: proceedings
  publisher:
    name: "Springer International Publishing"
  month: 5 # May
  start: 305 # First page number
  end: 322 # Last page number
  title: "A Programming Interface for Creating Data According to the SPAR Ontologies and the OpenCitations Data Model"
  year: 2022
  keywords:
  - OpenCitations
  - Python
  - RDF
  - rdflib
  - citation data
  - bibliographic metadata
  - SPAR Ontologies
  abstract: >-
    The OpenCitations Data Model (OCDM) is a data model for
    bibliographic metadata and citations based on the SPAR
    Ontologies and developed by OpenCitations to expose all
    the data of its collections as sets of RDF statements
    compliant with an ontology named OpenCitations Ontology.
    In this paper, we introduce oc_ocdm, i.e. a Python library
    developed for creating OCDM-compliant RDF data even if the
    programmer has no expertise in Semantic Web technologies.
    After an introduction of the library and its main
    characteristics, we show a number of projects within the
    OpenCitations infrastructure that adopt it as their
    building block unit.

GitHub Events

Total
  • Release event: 3
  • Watch event: 3
  • Delete event: 2
  • Issue comment event: 8
  • Push event: 26
  • Create event: 3
Last Year
  • Release event: 3
  • Watch event: 3
  • Delete event: 2
  • Issue comment event: 8
  • Push event: 26
  • Create event: 3

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 390
  • Total Committers: 3
  • Avg Commits per committer: 130.0
  • Development Distribution Score (DDS): 0.144
Past Year
  • Commits: 30
  • Committers: 2
  • Avg Commits per committer: 15.0
  • Development Distribution Score (DDS): 0.067
Top Committers
Name Email Commits
Simone Persiani i****a@g****m 334
arcangelo7 a****s@g****m 55
Arcangelo i****o@a****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 26
  • Total pull requests: 6
  • Average time to close issues: 6 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 2.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 10 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 2.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • iosonopersia (22)
  • arcangelo7 (4)
Pull Request Authors
  • arcangelo7 (4)
  • martasoricetti (2)
  • iosonopersia (1)
Top Labels
Issue Labels
enhancement (11) bug (6) missing feature (6) documentation (3) question (1) help wanted (1) released (1)
Pull Request Labels
released (6)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 483 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 56
  • Total maintainers: 1
pypi.org: oc_ocdm

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

  • Versions: 56
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 483 Last month
Rankings
Dependent packages count: 9.7%
Average: 36.9%
Dependent repos count: 64.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

poetry.lock pypi
  • alabaster 0.7.12 develop
  • babel 2.9.1 develop
  • colorama 0.4.4 develop
  • docutils 0.17.1 develop
  • imagesize 1.3.0 develop
  • jinja2 3.0.3 develop
  • markupsafe 2.1.0 develop
  • packaging 21.3 develop
  • pygments 2.11.2 develop
  • pytz 2021.3 develop
  • snowballstemmer 2.2.0 develop
  • sphinx 4.4.0 develop
  • sphinx-rtd-theme 1.0.0 develop
  • sphinxcontrib-applehelp 1.0.2 develop
  • sphinxcontrib-devhelp 1.0.2 develop
  • sphinxcontrib-htmlhelp 2.0.0 develop
  • sphinxcontrib-jsmath 1.0.1 develop
  • sphinxcontrib-qthelp 1.0.3 develop
  • sphinxcontrib-serializinghtml 1.1.5 develop
  • antlr4-python3-runtime 4.9.3
  • certifi 2021.10.8
  • cfgraph 0.2.1
  • chardet 4.0.0
  • charset-normalizer 2.0.12
  • hbreader 0.9.1
  • idna 3.3
  • importlib-metadata 4.11.1
  • isodate 0.6.1
  • jsonasobj 2.0.1
  • pyjsg 0.11.9
  • pyparsing 3.0.7
  • pyshex 0.8.0
  • pyshexc 0.9.0
  • rdflib 6.1.1
  • rdflib-jsonld 0.6.1
  • rdflib-shim 1.0.3
  • requests 2.27.1
  • shexjsg 0.8.1
  • six 1.16.0
  • sparqlslurper 0.5.1
  • sparqlwrapper 1.8.5
  • typing-extensions 4.1.1
  • urllib3 1.26.8
  • zipp 3.7.0
pyproject.toml pypi
  • Sphinx ^4.4.0 develop
  • sphinx_rtd_theme ^1.0.0 develop
  • PyShEx ^0.8.0
  • SPARQLWrapper ^1.8.5
  • python ^3.7.4
  • rdflib ^6.0.0