-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
95 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
API | ||
--- | ||
.. automodapi:: curies | ||
:no-inheritance-diagram: | ||
:no-heading: | ||
|
||
Integrating with :mod:`rdflib` | ||
------------------------------ | ||
RDFlib is a pure Python package for manipulating RDF data. The following example shows how to bind the | ||
prefix map from a :class:`curies.Converter` to a graph (:class:`rdflib.Graph`). | ||
|
||
.. code-block:: | ||
import curies, rdflib, rdflib.namespace | ||
converter = curies.get_obo_converter() | ||
graph = rdflib.Graph() | ||
for prefix, uri_prefix in converter.prefix_map.items(): | ||
graph.bind(prefix, rdflib.Namespace(uri_prefix)) | ||
A more flexible approach is to instantiate a namespace manager (:class:`rdflib.namespace.NamespaceManager`) | ||
and bind directly to that. | ||
|
||
.. code-block:: | ||
import curies, rdflib | ||
converter = curies.get_obo_converter() | ||
namespace_manager = rdflib.namespace.NamespaceManager(rdflib.Graph()) | ||
for prefix, uri_prefix in converter.prefix_map.items(): | ||
namespace_manager.bind(prefix, rdflib.Namespace(uri_prefix)) | ||
URI references for use in RDFLib's graph class can be constructed from | ||
CURIEs using a combination of :meth:`curies.Converter.expand` and :class:`rdflib.URIRef`. | ||
|
||
.. code-block:: | ||
import curies, rdflib | ||
converter = curies.get_obo_converter() | ||
uri_ref = rdflib.URIRef(converter.expand("CHEBI:138488")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CLI Usage | ||
--------- | ||
.. automodule:: curies.cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Identifier Mapping Service | ||
-------------------------- | ||
.. automodapi:: curies.mapping_service | ||
:no-inheritance-diagram: | ||
:no-heading: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Resolver Service | ||
---------------- | ||
.. automodapi:: curies.resolver_service | ||
:no-inheritance-diagram: | ||
:no-heading: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Data Structures | ||
=============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.