Skip to content

Commit

Permalink
Dev 0.7.0 (#39)
Browse files Browse the repository at this point in the history
* Provide feedback on schemes present. Refs #35

* Allow specifying which conceptscheme to use. Refs #35

* Filtering van concepten op basis van hun concept scheme. Refs #35

* Add an example with multiple conceptschemes. Refs #35

* Updating Python versions. Refs #63

* Test search matches. Refs #65

* Add long description content type. Refs #58

* Update dependencies.

* Refactoring of tests to use pytest. Refs #19

* Refactor writing html. Refs #68 (#70)
  • Loading branch information
koenedaele authored Feb 12, 2020
1 parent 933971e commit ce5c318
Show file tree
Hide file tree
Showing 22 changed files with 1,184 additions and 675 deletions.
7 changes: 7 additions & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
# see https://pyup.io/docs/configuration/ for all available options

schedule: every month

# Focus on production requirements, not development
requirements:
- requirements.txt:
update: all
- requirements-dev.txt:
update: insecure
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ sudo: false
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
install:
- pip install -U setuptools
- pip install -r requirements.txt
Expand Down
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.7.0 (12-02-2020)
------------------

- Compatibile with `SkosProvider 0.7.0 <http://skosprovider.readthedocs.io/en/0.7.0/>`_.
- Make it possible to read an RDF file containing more than one conceptscheme. (#35)
- Drop support for Python 3.3, 3.4 and 3.5. This is the last version that will
support Python 2. (#63)

0.6.0 (16-07-2017)
------------------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Onroerend Erfgoed
Copyright (c) 2014-2018 Onroerend Erfgoed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@

# General information about the project.
project = u'skosprovider_rdf'
copyright = u'2014-2017, Flanders Heritage Agency'
copyright = u'2014-2019, Flanders Heritage Agency'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.6'
version = '0.7'
# The full version, including alpha/beta/rc tags.
release = '0.6.0'
release = '0.7.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -273,7 +273,7 @@
epub_title = u'skosprovider_rdf'
epub_author = u'Karel Dieussaert'
epub_publisher = u'Flanders Heritage Agency'
epub_copyright = u'2014, Flanders Heritage Agency'
epub_copyright = u'2014-2018, Flanders Heritage Agency'

# The basename for the epub file. It defaults to the project name.
#epub_basename = u'skosprovider_rdf'
Expand Down
14 changes: 14 additions & 0 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ itself does not read the :term:`SKOS` file, but expects to be passed a
.. literalinclude:: /../examples/load_skos.py
:language: python

Out of the box :mod:`skosprovider_rdf` assumes your :term:`RDF` file contains
exactly one conceptscheme. If no conceptscheme is found in the file and you did
not pass one to the provider through the `concept_scheme` parameter, a new
conceptscheme is automatically created. If more than one conceptscheme is
present in the file, you can again specify the conceptscheme through the
`concept_scheme` parameter (passing a :class:`skosprovider.skos.ConceptScheme`)
or you can pass the uri of one of the conceptschemes present in the
`concept_scheme_uri` parameter. When you specify a conceptscheme like this, only
the concepts linked to this scheme through `skok:inScheme` statements will be
loaded.

.. literalinclude:: /../examples/load_specific_scheme.py
:language: python

It also provides a utility function to dump any implementation
of :class:`skosprovider.providers.VocabularyProvider` to a
:class:`rdflib.graph.Graph`. Again, since the provider only deals with the
Expand Down
4 changes: 2 additions & 2 deletions examples/dump.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
'''
This script demonstrates dumping a
This script demonstrates dumping a
:class:`skosprovider.providers.SimpleCsvProvider` as a RDF Graph. In this
case, `n3` serialisation is used, other serialisations are available through
:mod:`rdflib`.
Expand Down Expand Up @@ -49,4 +49,4 @@

graph = rdf_dumper(csvprovider)

print graph.serialize(format='n3')
print(graph.serialize(format='n3'))
34 changes: 17 additions & 17 deletions examples/load_skos.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
graph.parse(file, format="turtle")

provider = RDFProvider(
{'id': 'PRODUCTS'},
{'id': 'PRODUCTS'},
graph
)

print "provider.get_all()"
print "------------------"
print provider.get_all()
print ""
print("provider.get_all()")
print("------------------")
print(provider.get_all())
print("")

print "provider.find({'label': 'jewelry'})"
print "-----------------------------------"
print provider.find({'label': 'jewelry'})
print ""
print("provider.find({'label': 'jewelry'})")
print("-----------------------------------")
print(provider.find({'label': 'jewelry'}))
print("")


print "provider.get_by_id('http://wwww.products.com/Jewellery')"
print "--------------------------------------------------------"
print provider.get_by_id('http://www.products.com/Jewellery')
print ""
print("provider.get_by_id('http://wwww.products.com/Jewellery')")
print("--------------------------------------------------------")
print(provider.get_by_id('http://www.products.com/Jewellery'))
print("")

print "provider.get_by_uri('http://wwww.products.com/Jewellery')"
print "---------------------------------------------------------"
print provider.get_by_uri('http://www.products.com/Jewellery')
print ""
print("provider.get_by_uri('http://wwww.products.com/Jewellery')")
print("---------------------------------------------------------")
print(provider.get_by_uri('http://www.products.com/Jewellery'))
print("")
42 changes: 42 additions & 0 deletions examples/load_specific_scheme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
'''
This examples fetches only one conceptscheme from a turtle file containing two.
'''

import os

from rdflib import Graph

from skosprovider_rdf.providers import RDFProvider

graph = Graph()

file = os.path.join(os.path.dirname(__file__), '..', 'tests', 'data', 'waarde_en_besluit_types.ttl')
graph.parse(file, format="turtle")

provider = RDFProvider(
{'id': 'WAARDETYPES'},
graph,
concept_scheme_uri = 'https://id.erfgoed.net/thesauri/waardetypes'
)

print("provider.get_all()")
print("------------------")
print(provider.get_all())
print("")

print("provider.find({'label': 'esthetische waarde'})")
print("-----------------------------------")
print(provider.find({'label': 'esthetische waarde'}))
print("")


print("provider.get_by_id(46)")
print("--------------------------------------------------------")
print(provider.get_by_id('46'))
print("")

print("provider.get_by_uri('https://id.erfgoed.net/thesauri/waardetypes/46')")
print("---------------------------------------------------------")
print(provider.get_by_uri('https://id.erfgoed.net/thesauri/waardetypes/46'))
print("")
7 changes: 4 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--requirement requirements.txt

# Testing
pytest==3.7.4
pytest-cov==2.5.1
coveralls==1.5.0
pytest==4.6.9 ; python_version < '3.0'
pytest==5.3.5 ; python_version >= '3.0'
pytest-cov==2.8.1
coveralls==1.11.2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
skosprovider==0.6.1
# -e git+https://github.com/koenedaele/skosprovider.git#egg=skosprovider
skosprovider==0.7.0
# -e git+https://github.com/koenedaele/skosprovider.git@DEV_0.7.0#egg=skosprovider
rdflib==4.2.2
html5lib==1.0.1
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

setup(
name='skosprovider_rdf',
version='0.6.0',
version='0.7.0',
description='skosprovider_rdf',
long_description=README + '\n\n' + HISTORY,
long_description_content_type='text/x-rst',
package_data={'': ['LICENSE']},
package_dir={'skosprovider_rdf': 'skosprovider_rdf'},
include_package_data=True,
Expand All @@ -39,10 +40,9 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
author='Flanders Heritage Agency',
author_email='[email protected]',
Expand Down
Loading

0 comments on commit ce5c318

Please sign in to comment.