Skip to content

Commit

Permalink
Do not attempt to create link for certain classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
recalcitrantsupplant committed Oct 24, 2024
1 parent 94fe37d commit d15501c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prez/services/link_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ async def _link_generation(
URIRef("http://example.org/ns#Search"),
URIRef("http://example.org/ns#TopConcepts"),
URIRef("http://example.org/ns#Narrowers"),
URIRef("http://example.org/ns#QueryablesGlobal"),
URIRef("http://example.org/ns#QueryablesLocal"),
URIRef("http://example.org/ns#Feature"), # creation of these links is hardcoded in the OGC Features API
URIRef("http://example.org/ns#FeatureCollections"), # creation of these links is hardcoded in the OGC Features API
]
]
# run queries for available nodeshapes to get link components
Expand Down
23 changes: 23 additions & 0 deletions test_data/issue_286.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX ex: <http://example.org/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sdo: <https://schema.org/>
PREFIX sosa: <http://www.w3.org/ns/sosa/>

ex:cat a dcat:Catalog;
rdfs:label "a catalog";
dcterms:hasPart ex:res .

ex:res a dcat:Resource;
rdfs:label "a resource";
sosa:isFeatureOfInterestOf [ a sosa:Observation;
sosa:hasResult [ a sosa:Result;
rdfs:label "a result";
sdo:value ex:feat
]
] .

ex:feat a geo:Feature;
rdfs:label "a feature" .
3 changes: 3 additions & 0 deletions tests/test_issue_286.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_issue(client):
r = client.get(f"/catalogs/ex:cat/collections/ex:res")
assert r.status_code == 200

0 comments on commit d15501c

Please sign in to comment.