Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catalogs listing query bug #271

Open
lalewis1 opened this issue Oct 1, 2024 · 8 comments
Open

catalogs listing query bug #271

lalewis1 opened this issue Oct 1, 2024 · 8 comments
Assignees

Comments

@lalewis1
Copy link
Collaborator

lalewis1 commented Oct 1, 2024

Issue

browsing /catalogs shows no results.

expected behaviour

a list of catalogs is returned.

suspected cause

the main query generated by

main_query = PrezQueryConstructor(
seems to have lost a reference to dcat:Resource after PR #265

the code for the listings_function function and PrezQueryConstructor class don't seem to have been changed so probably it is a profile thing.

question

is this the intended behaviour now? or is this a bug

note

see below screengrab for old vs new query as captured in the debugger

Screenshot From 2024-10-01 13-54-06

@recalcitrantsupplant
Copy link
Collaborator

recalcitrantsupplant commented Oct 1, 2024

There was an ongoing discussion here #235

However.. I have some changes to define custom endpoints I'll push soon.

What's the full set of your Classes / relations between them?

Something like this?

{
          "name": "Catalog Record",
          "hierarchy": [
            {
              "rdfClass": "http://www.w3.org/ns/dcat#Catalog",
              "className": "Catalog",
              "hierarchyLevel": 1
            },
            {
              "rdfClass": "http://www.w3.org/ns/dcat#Dataset",
              "className": "Dataset",
              "hierarchyLevel": 2
            },
            {
              "rdfClass": "http://www.w3.org/ns/dcat#Resource",
              "className": "Resource",
              "hierarchyLevel": 3
            }
          ],
          "relations": [
            {
              "levelFrom": 1,
              "levelTo": 2,
              "direction": "outbound",
              "rdfPredicate": "http://purl.org/dc/terms/hasPart"
            },
            {
              "levelFrom": 2,
              "levelTo": 3,
              "direction": "outbound",
              "rdfPredicate": "http://purl.org/dc/terms/hasPart"
            }
          ]
        }

any others? vocab routes?

@lalewis1
Copy link
Collaborator Author

lalewis1 commented Oct 1, 2024

yeah I have some vocab with just two levels

skos:Concept -- skos:inScheme --> skos:ConceptScheme

and the catalog record heirarchy is just

dcat:Catalog -- dcterms:hasPart --> dcat:Resource

@recalcitrantsupplant
Copy link
Collaborator

Could you confirm if it's still an issue when defining your own custom endpoints now #274 has been merged

@lalewis1
Copy link
Collaborator Author

lalewis1 commented Oct 8, 2024

well it is still an issue in the sense that it does not show catalogs that only have dcat:Resources in them by default.
it works after defining a custom endpoint and I guess that is OK if that is the behaviour that we want.

would it be a problem to add dcat:Resource to the default endpoint nodeshape properties?

@recalcitrantsupplant
Copy link
Collaborator

Ah, I had in fact added it back to the default endpoints too
I'll add a test now

ex:shape-R0-HL3-2 a sh:NodeShape ;
    sh:property [ sh:class dcat:Dataset ;
            sh:path [ sh:inversePath dcterms:hasPart ] ],
        [ sh:class dcat:Catalog ;
            sh:path ( [ sh:inversePath dcterms:hasPart ] [ sh:inversePath dcterms:hasPart ] ) ] ;
    sh:targetClass dcat:Resource ;
    ont:hierarchyLevel 3 .

@lalewis1
Copy link
Collaborator Author

lalewis1 commented Oct 8, 2024

doesn't that only allow

dcat:Catalog --dcterms:hasPart--> dcat:Dataset --dcterms:hasPart--> dcat:Resource

but I am suggesting to allow

dcat:Catalog --dcterms:hasPart--> dcat:Resource

recalcitrantsupplant added a commit that referenced this issue Oct 9, 2024
@recalcitrantsupplant
Copy link
Collaborator

Apologies yes the former there

@nicholascar what is the preferred Prez default for "CatPrez" - is it to have the three tier Catalog/Dataset/Resource or the Catalog/Resource . Whichever we choose, we can support the other via configurable endpoints, just need to decide what we want the default to be.

@nicholascar
Copy link
Member

Catalog/Resource

It's simpler and also it's the OGC Records API equivalent which is the "top-level" style catalogue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants