|
1 | | - |
| 1 | + |
| 2 | + |
| 3 | +# RDFLib |
2 | 4 |
|
3 | | -RDFLib |
4 | | -====== |
5 | 5 | [](https://github.com/RDFLib/rdflib/actions?query=branch%3Amain) |
6 | 6 | [](https://rdflib.readthedocs.io/en/latest/?badge=latest) |
7 | 7 | [](https://coveralls.io/r/RDFLib/rdflib?branch=main) |
@@ -30,8 +30,10 @@ The RDFlib community maintains many RDF-related Python code repositories with di |
30 | 30 |
|
31 | 31 | * [rdflib](https://github.com/RDFLib/rdflib) - the RDFLib core |
32 | 32 | * [sparqlwrapper](https://github.com/RDFLib/sparqlwrapper) - a simple Python wrapper around a SPARQL service to remotely execute your queries |
33 | | -* [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE |
34 | | -* [pySHACL](https://github.com/RDFLib/pySHACL) - A pure Python module which allows for the validation of RDF graphs against SHACL graphs |
| 33 | +* [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE. |
| 34 | +* [pyrdfa3](https://github.com/RDFLib/pyrdfa3) - RDFa 1.1 distiller/parser library: can extract RDFa 1.1/1.0 from (X)HTML, SVG, or XML in general. |
| 35 | +* [pymicrodata](https://github.com/RDFLib/pymicrodata) - A module to extract RDF from an HTML5 page annotated with microdata. |
| 36 | +* [pySHACL](https://github.com/RDFLib/pySHACL) - A pure Python module which allows for the validation of RDF graphs against SHACL graphs. |
35 | 37 | * [OWL-RL](https://github.com/RDFLib/OWL-RL) - A simple implementation of the OWL2 RL Profile which expands the graph with all possible triples that OWL RL defines. |
36 | 38 |
|
37 | 39 | Please see the list for all packages/repositories here: |
@@ -136,18 +138,21 @@ g.add(( |
136 | 138 | Literal("Nick", datatype=XSD.string) |
137 | 139 | )) |
138 | 140 | ``` |
| 141 | + |
139 | 142 | The triple (in n-triples notation) `<http://example.com/person/nick> <http://xmlns.com/foaf/0.1/givenName> "Nick"^^<http://www.w3.org/2001/XMLSchema#string> .` |
140 | 143 | is created where the property `FOAF.givenName` is the URI `<http://xmlns.com/foaf/0.1/givenName>` and `XSD.string` is the |
141 | 144 | URI `<http://www.w3.org/2001/XMLSchema#string>`. |
142 | 145 |
|
143 | 146 | You can bind namespaces to prefixes to shorten the URIs for RDF/XML, Turtle, N3, TriG, TriX & JSON-LD serializations: |
144 | 147 |
|
145 | | - ```python |
| 148 | +```python |
146 | 149 | g.bind("foaf", FOAF) |
147 | 150 | g.bind("xsd", XSD) |
148 | 151 | ``` |
| 152 | + |
149 | 153 | This will allow the n-triples triple above to be serialised like this: |
150 | | - ```python |
| 154 | + |
| 155 | +```python |
151 | 156 | print(g.serialize(format="turtle")) |
152 | 157 | ``` |
153 | 158 |
|
|
0 commit comments