Support for PIDs and (non-Geo)JSON-LD (#676)

* Update api.py for uri_field

* Update linked_data.py

Update to meet the needs of https://github.com/internetofwater/geoconnex.us/issues/93

* Add uri_field to base.py provider

* Update index.html

Push uri-like field to front of list in collections/items

* Update api.py

Allow html files to handle uri_field

* Add trailing / to schema context

* Add uri_field to collections index page

* Add uri_field to collections item html page

* Update api.py

* Update configuration.rst

* fixed spelling

* Update configuration.rst

* Update configuration.rst

* Update configuration.rst

* Update sqlite.py

* Update linked_data.py

* Update api.py

* Revert 'id' cast to string

* Update configuration.rst

* Update linked_data.py

* Update api.py

* Update linked_data.py

* Update configuration.rst for json boolean

Co-authored-by: Benjamin Webb <40066515+webb-ben@users.noreply.github.com>
This commit is contained in:
Kyle Onda
2021-04-27 19:44:19 -04:00
committed by GitHub
parent 3b0cc014d4
commit 589df6370a
6 changed files with 130 additions and 44 deletions
+8 -1
View File
@@ -147,6 +147,7 @@ default.
keywords: # list of related keywords
- observations
- monitoring
geojsonld: true # use default geojsonld behavior (see Linked Data section)
context: # linked data configuration (see Linked Data section)
- datetime: https://schema.org/DateTime
- vocab: https://example.com/vocab#
@@ -175,6 +176,7 @@ default.
name: CSV
data: tests/data/obs.csv # required: the data filesystem path or URL, depending on plugin setup
id_field: id # required for vector data, the field corresponding to the ID
uri_field: uri # optional field corresponding to the Uniform Resource Identifier (see Linked Data section)
time_field: datetimestamp # optional field corresponding to the temporal property of the dataset
title_field: foo # optional field of which property to display as title/label on HTML pages
format: # optional default format
@@ -232,12 +234,17 @@ The metadata for an instance is determined by the content of the `metadata`_ sec
This metadata is included automatically, and is sufficient for inclusion in major indices of datasets, including the
`Google Dataset Search`_.
For collections, at the level of an item or items, by default the JSON-LD representation adds:
For collections, at the level of an item or items, the default the JSON-LD representation adds:
- The GeoJSON JSON-LD `vocabulary and context <https://geojson.org/geojson-ld/>`_ to the ``@context``.
- An ``@id`` for each item in a collection, that is the URL for that item (resolving to its HTML representation
in pygeoapi)
The optional configuration options for collections, at the level of an item of items, are:
- If ``geojsonld`` is not specified or is ``true``, the JSON-LD will conform to the default configuration presenting GeoJSON-LD. If ``geojsonld`` is ``false`` the individual item JSON-LD will conform to standard JSON-LD, and the ``@context`` will not include the geojson vocabulary, but only one specifying the ``@id`` property, the ``@type`` property, and schema.org/ vocabulary. In addition, properties block will be expanded into the main body, non-point geometry will be removed, and point-type geometry will be represented as https://schema.org geometry instead of geojson.
- If ``uri_field`` is specified, JSON-LD will be updated such that ``@id:uri_field`` for each item in a collection.
.. note::
While this is enough to provide valid RDF (as GeoJSON-LD), it does not allow the *properties* of your items to be
unambiguously interpretable.