archesproject / arches-lingo

Arches Reference Data Manager Application
GNU Affero General Public License v3.0
0 stars 0 forks source link

URI Generator Function Per Semantic Node #1

Open Habennin opened 1 year ago

Habennin commented 1 year ago

Background

For internal management of nodes Arches assigns to every root instance and every semantic node a UUID (I think).

Problem

In linked open data and vocabulary management practice the URI of an instance should not be a UUID but should be a unique identifier within a namespace.

Requirement

Instances of Resource models should be able to have defined URI patterns in a namespace according to semantic web standards.

Proposal

Add a function to the 'card' controller of the root node and semantic nodes which allows a database admin to specify how the URI for that node should be constructed.

URI construction usually requires building up a unique identifier from multiple pieces of information within a resource.

Take the example of

Currently the system will just apply a random UUID to the entity. In the semantic web, this won't work, it needs a namespaced, potentially deferencible URI.

A rule could be:

http://example.com/person/1 http://example.com/person/2

To achieve this for the root node, we would need a function that would allow you to specify a namespace "http://example.com", specify a potential constant, e.g.: "person" and then grab something unique by which to make sure that two different entities aren't assigned the same URI. In this case we assume there is a field that holds an integer value somewhere and it has an auto increment function set on it.

Potential technology: https://github.com/json-path/JsonPath Json path is like Xpath and allows the user to specify different points in the JSON tree from which data can be pulled while also inserting constants etc.

A technology like this would be useful also for EVERY semantic node, since it is not just John Smith who needs a URI but each and every one of his semantic nodes. E.g.: his birth node, his death node

Creating a good URI pattern for a related node requires a good understanding of the data and a tool like JSON path that allows one to pick out just the data one needs.

For example the birth node might look like this

http://example.com/person/1/event/birth http://example.com/person/2/event/birth

Here the job is easy because a person can only have one birth so a constant could be put in for 'event/birth' and it will create the unique identifier for the one birth of the person.

For a professional activity, however, we might need something more complicated.

http://example.com/person/1/event/pro_activity/1 http://example.com/person/2/event/pro_activity/2

The 1 and 2 could be pulled from another auto incrementer or they could be subsittuted with a UUID inserter.

Habennin commented 1 year ago

related issue:

https://github.com/archesproject/arches-for-science/issues/1368