oc_ocdm
Object mapping library for manipulating RDF graphs that are compliant with the OpenCitations datamodel.
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
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
Metadata Files
README.md
oc_ocdm
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
- Install Poetry:
bash pip install poetry - Clone this repository:
bash git clone https://github.com/opencitations/oc_ocdm cd ./oc_ocdm - Install all the dependencies:
bash poetry install - Build the package (output dir:
dist):bash poetry build - 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 - If everything went the right way, than you should be able to use the
oc_ocdmlibrary 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
- Always remember to move inside the
docsfolder:bash cd docs - Use the Makefile provided to build the docs:
- on Windows
make.bat html - on Linux and MacOs
make html
- on Windows
- Open the
build/html/index.htmlfile 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
- Website: opencitations.net
- Twitter: opencitations
- Repositories: 52
- Profile: https://github.com/opencitations
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
Top Committers
| Name | 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
Pull Request Labels
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.
- Homepage: https://opencitations.net
- Documentation: https://oc-ocdm.readthedocs.io
- License: ISC
-
Latest release: 9.2.2
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- 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
- 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