RDFLib / prez

Prez is a data-configurable Linked Data API framework that delivers profiles of Knowledge Graph data according to the Content Negotiation by Profile standard.
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

URI - URL alignement #232

Closed tendrie closed 3 weeks ago

tendrie commented 3 weeks ago

Hi all,

We are trying to find "rules" from our proxy/resolver to make the URL of ressources in prez UI corresponding to the URI of the ressource itself. In prez API, it's ok.

Is it possible to perform that by rewriting rules?

  1. for datasets: s/datasets/**
  2. for catalogs: c/catalogs/*****

how the "**" part is generated? there is some namespace prefixes within and how it is generated.

Could you give us some idea to do so? It's really important for our UC that the URI and the URL remains the same.

Thank you

recalcitrantsupplant commented 3 weeks ago

The xxx parts of the links are CURIES. The namespace prefixes for the curies can either be generated on startup, or specified. The generation function is intended to be deterministic but it's not guaranteed. Specifying prefixes should make them deterministic. I would recommend specifying prefixes - this will also mean you can choose "nice" prefixes. You can specify prefixes by adding a turtle file to prez/reference data/prefixes, use the same format as the existing files in that location. If you need to identity the namespaces used in your data, there is a sparql query on the developer readme to assist with this.

recalcitrantsupplant commented 3 weeks ago

@tendrie did you have any success with the above?

tendrie commented 3 weeks ago

@recalcitrantsupplant Thank you for your answer, we have tried to specify prefixes as you said, and it works nicely. Thank you