CSIRO-enviro-informatics / pyldapi

A very small module to add Linked Data API functionality to a Python Flask installation
GNU General Public License v3.0
1 stars 0 forks source link

Change the RDF.type of each rendered instance item in a registry to the actual type of the item. #12

Closed ashleysommer closed 6 years ago

ashleysommer commented 6 years ago

This is currently a bug, as first mentioned here: https://github.com/CSIRO-enviro-informatics/pyldapi/issues/8 g.add((item_uri, RDF.type, URIRef(self.uri))) self.uri is not the correct variable to use for the RDF.type for each item.

The registry renderer currently cannot know the real RDF:type of a registry_item, except to pull it from the contained_item_classes list. If the contained_item_classes list contains more than one class, then it is not possible to know the real RDF:type of a particular registry_item.

An easy way to fix this temporarily for now is to be able to pass in the individual instance item class in the tuple for each registry_item, if the tuple doesn't contain a class, but the list of contained_item_classes contains only one item, then use that as the item's RDF:type.