diff options
| author | Nicholas Car <nicholas.car@csiro.au> | 2020-04-18 11:20:37 +1000 |
|---|---|---|
| committer | Nicholas Car <nicholas.car@csiro.au> | 2020-04-18 11:20:37 +1000 |
| commit | db555f4eb790e10f36b5683272600d3dd3302be8 (patch) | |
| tree | f2ceb26fc17973b8d9ca1eafd677ff239eeb1356 | |
| parent | d26bf839034db3c6baed4cf9afabf638389450d9 (diff) | |
| download | rdflib-db555f4eb790e10f36b5683272600d3dd3302be8.tar.gz | |
update CHANGELOG & README for 5.0.0 release
| -rw-r--r-- | CHANGELOG.md | 35 | ||||
| -rw-r--r-- | README.md | 138 |
2 files changed, 136 insertions, 37 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a54ab169..a72b4d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +2020/04/18 RELEASE 5.0.0 +======================== +5.0.0 is a major stable release and is the last release to support Python 2 & 3.4. 5.0.0 is mostly backwards- +compatible with 4.2.2 and is intended for long-term, bug fix only support. + +5.0.0 comes two weeks after the 5.0.0RC1 and includes a small number of additional bug fixes. Note that +rdflib-jsonld has released a version 0.5.0 to be compatible with rdflib 5.0.0. + +_**All PRs merged since 5.0.0RC1:**_ + +### General Bugs Fixed: + * Fix n3 parser exponent syntax of floats with leading dot. + [PR #1012](https://github.com/RDFLib/rdflib/pull/1012) + * FIX: Change is comparison to == for tuple + [PR #1009](https://github.com/RDFLib/rdflib/pull/1009) + * fix #913 : Added _parseBoolean function to enforce correct Lexical-to-value mapping + [PR #995](https://github.com/RDFLib/rdflib/pull/995) + +### Enhanced Features: + * Issue 1003 + [PR #1005](https://github.com/RDFLib/rdflib/pull/1005) + +### SPARQL Fixes: + * CONSTRUCT resolve with initBindings fixes #1001 + [PR #1002](https://github.com/RDFLib/rdflib/pull/1002) + +### Documentation Fixes: + * DOC: Use sphinxcontrib-apidoc and various cleanups + [PR #1010](https://github.com/RDFLib/rdflib/pull/1010) + * Update copyright year in docs conf.py + [PR #1006](https://github.com/RDFLib/rdflib/pull/1006) + * slightly improved styling, small index text changes + [PR #1004](https://github.com/RDFLib/rdflib/pull/1004) + + 2020/04/04 RELEASE 5.0.0RC1 =========================== @@ -1,3 +1,5 @@ + + RDFLib ====== [](https://travis-ci.org/RDFLib/rdflib) @@ -6,98 +8,160 @@ RDFLib [](https://pypi.python.org/pypi/rdflib) [](https://pypi.python.org/pypi/rdflib) +RDFLib is a pure Python package work working with [RDF](http://www.w3.org/RDF/). RDFLib contains most things you need to work with RDF, including: + +* parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig and JSON-LD (via a plugin). +* a Graph interface which can be backed by any one of a number of Store implementations +* store implementations for in-memory storage and persistent storage on top of the Berkeley DB +* a SPARQL 1.1 implementation - supporting SPARQL 1.1 Queries and Update statements + +## RDFlib Family of packages +The RDFlib community maintains many RDF-related Python code repositories with different purposes. For example: + +* [rdflib](https://github.com/RDFLib/rdflib) - the rdflib core +* [sparqlwrapper](https://github.com/RDFLib/sparqlwrapper) - a simple Python wrapper around a SPARQL service to remotely execute your queries +* [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE. +* [rdflib-jsonld](https://github.com/RDFLib/rdflib-jsonld) - an rdflib plugin that is an implementation of JSON-LD -RDFLib is a Python library for working with RDF, a simple yet -powerful language for representing information as graphs. +Please see the list for all packages/repositories here: -RDFLib may be installed with pip (use sudo as required): +* <https://github.com/RDFLib> + + +## Installation +RDFLib may be installed with Python's package management tool *pip*: $ pip install rdflib Alternatively manually download the package from the Python Package Index (PyPI) at https://pypi.python.org/pypi/rdflib -The current version of RDFLib is 4.2.2, see the ``CHANGELOG.md`` -file for what's new. +The current version of RDFLib is 5.0.0, see the ``CHANGELOG.md`` +file for what's new in this release. -Getting Started ---------------- +## Getting Started +RDFLib aims to be a pythonic RDF API. rdflib's main data object is a `Graph` which is a Python collection +of RDF *Subject, Predicate, Object* Triples: -RDFLib aims to be a pythonic RDF API, a Graph is a python collection -of RDF Subject,Predicate,Object Triples: +To create graph and load it with RDF data from DBPedia then print the results: ```python import rdflib -g=rdflib.Graph() +g = rdflib.Graph() g.load('http://dbpedia.org/resource/Semantic_Web') -for s,p,o in g: +for s, p, o in g: print(s, p, o) ``` - The components of the triples are URIs (resources) or Literals -(values), URIs are grouped together by *namespace*, common namespaces are +(values). + +URIs are grouped together by *namespace*, common namespaces are included in RDFLib: ```python - -semweb=rdflib.URIRef('http://dbpedia.org/resource/Semantic_Web') -type=g.value(semweb, rdflib.RDFS.label) +from rdflib.namespace import DC, DCTERMS, DOAP, FOAF, SKOS, OWL, RDF, RDFS, VOID, XMLNS, XSD ``` +You can use them like this: + +```python +semweb = rdflib.URIRef('http://dbpedia.org/resource/Semantic_Web') +type = g.value(semweb, rdflib.RDFS.label) +``` Where `rdflib.RDFS` is the RDFS Namespace, `graph.value` returns an object of the triple-pattern given (or an arbitrary one if more -exist). New Namespaces can also be defined: +exist). + +Or like this, adding a triple to a graph `g`: ```python +g.add(( + rdflib.URIRef("http://example.com/person/nick"), + FOAF.givenName, + rdflib.Literal("Nick", datatype=XSD.string) +)) +``` +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> .` +is created where the property `FOAF.giveName` is the URI `<http://xmlns.com/foaf/0.1/givenName>` and `XSD.string` is the +URI `<http://www.w3.org/2001/XMLSchema#string>`. -dbpedia=rdflib.Namespace('http://dbpedia.org/ontology/') +You can bind namespaces to prefixes to shorten the URIs for RDF/XML, Turtle, N3, TriG, TriX & JSON-LD serializations: -abstracts=list(x for x in g.objects(semweb, dbpedia['abstract']) if x.language=='en') + ```python +g.bind("foaf", FOAF) +g.bind("xsd", XSD) +``` +This will allow the n-triples triple above to be serialised like this: + ```python +print(g.serialize(format="turtle").decode("utf-8")) ``` -See also [./examples](./examples) +With these results: +```turtle +PREFIX foaf: <http://xmlns.com/foaf/0.1/> +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> + +<http://example.com/person/nick> foaf:givenName "Nick"^^xsd:string . +``` + +New Namespaces can also be defined: + +```python +dbpedia = rdflib.Namespace('http://dbpedia.org/ontology/') +abstracts = list(x for x in g.objects(semweb, dbpedia['abstract']) if x.language=='en') +``` + +See also [./examples](./examples) -Features --------- +## Features The library contains parsers and serializers for RDF/XML, N3, -NTriples, N-Quads, Turtle, TriX, RDFa and Microdata. +NTriples, N-Quads, Turtle, TriX, RDFa and Microdata. JSON-LD parsing/serializing can be achieved using the +[JSON-LD plugin](https://github.com/RDFLib/rdflib-jsonld). The library presents a Graph interface which can be backed by any one of a number of Store implementations. This core RDFLib package includes store implementations for -in memory storage and persistent storage on top of the Berkeley DB. +in-memory storage and persistent storage on top of the Berkeley DB. A SPARQL 1.1 implementation is included - supporting SPARQL 1.1 Queries and Update statements. RDFLib is open source and is maintained on [GitHub](https://github.com/RDFLib/rdflib/). RDFLib releases, current and previous are listed on [PyPI](https://pypi.python.org/pypi/rdflib/) -RDFLib has a plugin-architecture for store-implementation, as well as parsers/serializers, several other projects exist which extend RDFLib features: +Multiple other projects are contained within the RDFlib "family", see <https://github.com/RDFLib/>. + + +## Documentation +See <https://rdflib.readthedocs.io> for our documentation built from the code. + + +## Support +For general "how do I..." queries, please use https://stackoverflow.com and tag your question with `rdflib`. +Existing questions: - * [rdflib-jsonld](https://github.com/RDFLib/rdflib-jsonld) - Serializer and parser for [json-ld](http://json-ld.org) +* <https://stackoverflow.com/questions/tagged/rdflib> -Support -------- -More information is available on the project webpage: +## Releases +See <https://rdflib.dev> for the release schedule. -https://github.com/RDFLib/rdflib/ -The documentation can be built by doing:: +## Contributing +rdflib survives and grows via user contributions! Please consider lodging Pull Requests here: - $ python setup.py build_sphinx +* <https://github.com/RDFLib/rdflib/pulls> -And is also available from ReadTheDocs: +You can also raise issues here: -https://rdflib.readthedocs.io +* <https://github.com/RDFLib/rdflib/issues> -Support is available through the rdflib-dev group: -https://groups.google.com/group/rdflib-dev +## Contacts +If you want to contact the rdflib maintainers, please do so via the rdflib-dev mailing list: -and on the IRC channel #rdflib on the freenode.net server +* <https://groups.google.com/group/rdflib-dev> |
