Skip to content

Extend the context file to get better RDF coverage#234

Merged
Ludee merged 56 commits intodevelopfrom
feature-232-extend-context
Jan 23, 2025
Merged

Extend the context file to get better RDF coverage#234
Ludee merged 56 commits intodevelopfrom
feature-232-extend-context

Conversation

@jh-RLI
Copy link
Copy Markdown
Contributor

@jh-RLI jh-RLI commented Jan 8, 2025

Summary of the discussion

We want to provide the oemetadata in an RDF using json-ld. We already provide a simple / basic context.json file but we want to attempt to cover 100% of the oemetadata properties. As it is not always easy to find matching ontology terms to map the properties. 100% coverage might not be feasible.

Type of change (CHANGELOG.md)

Added

  • Add test for @context with the example.json as valid JSON-LD (#234)

Changed

  • Update the context.json and add terms for all keys (#234)

Workflow checklist

Automation

Closes #232

PR-Assignee

  • 🐙 Follow the workflow in CONTRIBUTING.md
  • 📝 Update the CHANGELOG.md
  • 📙 Update the documentation
  • 🐙 Assign a reviewer to the PR

Reviewer

  • 🐙 Follow the Reviewer Guidelines
  • 🐙 Provided feedback and show sufficient appreciation for the work done

@jh-RLI jh-RLI marked this pull request as draft January 8, 2025 15:14
@jh-RLI jh-RLI added priority: critical 🔥 Critical priority status: active 🚧 Work in progress labels Jan 9, 2025
@jh-RLI jh-RLI marked this pull request as ready for review January 9, 2025 16:23
@Ludee Ludee self-requested a review January 13, 2025 09:48
@Ludee Ludee marked this pull request as draft January 13, 2025 09:49
@Ludee Ludee added part: backend 🧱 Backend component type: feature 🛠 New feature or request labels Jan 14, 2025
@vismayajochem
Copy link
Copy Markdown
Collaborator

vismayajochem commented Jan 21, 2025

Following ontology classes appear in the oekg:

  • rdfs:label
  • not dct:title (json-ld) but DC:title (oekg)
  • not dct:description (json-ld) but DC:description (oekg)
  • not sc:url (json-ld)l but SCHEMA:url (oekg) which should be the exact same
  • not dct:descrpition but DC:description

@Ludee
Copy link
Copy Markdown
Member

Ludee commented Jan 21, 2025

Dublin Core (DC)
dc: DC Elements (15 terms) "Dublin Core Principles"
dct: DC Terms (15 terms + ranges) "Dublin Core Terms"

Unless you have a reason for using the terms from the Element Set .., go with the terms from the Terms namespace

source: https://stackoverflow.com/questions/47519315/what-is-the-difference-between-dublin-core-terms-and-dublin-core-elements-vocabu

@Ludee
Copy link
Copy Markdown
Member

Ludee commented Jan 22, 2025

subject (General Keys)
8.1 | name -> rdfs:label
8.2 | @id -> dct:subject

context:

            "@container": "@set",
            "@id": "dct:subject"
        },```
        
Should that be a "nest" as well?

@jh-RLI
Copy link
Copy Markdown
Contributor Author

jh-RLI commented Jan 22, 2025

This is a bit experimental as the container feature was added to the json-ld specification not too long ago. The decision about using “nest” or “container” for properties that are used to group other properties is not 100% settled yet. For this reason, I have introduced the container for groups for which I have found a term, and as nest for groups for which I could not find a term. As far as I understand it, the “container” can help to improve the graph structure derived from the json-ld mapping in context using a parser.

I would like to keep this for future discussions. It's valid and doesn't seem to interfere with any other functionality so far.

EDIT: Another constrain for how to decide between @nest and @container usage is the structure of the property once wants to annotate. If the property is a list (e.g. "xyz": [ ... ]) than you can use the container with type: @set oder @list if the property is a complex type (e.g. "xyz": { "prop": "val", "prop2": "val2" }) then we cant use a container without defining the type in the json data at the position of the related property xyz. The json ld parser will otherwise raise an error.

subject (General Keys) 8.1 | name -> rdfs:label 8.2 | @id -> dct:subject

context:

            "@container": "@set",
            "@id": "dct:subject"
        },```
        
Should that be a "nest" as well?

@Ludee Ludee merged commit dc34126 into develop Jan 23, 2025
@Ludee Ludee deleted the feature-232-extend-context branch January 23, 2025 20:29
@Ludee Ludee added status: completed ✔️ Task has been completed and removed status: active 🚧 Work in progress labels Jan 23, 2025
@Ludee Ludee linked an issue Jan 23, 2025 that may be closed by this pull request
1 task
@Ludee Ludee removed the priority: critical 🔥 Critical priority label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part: backend 🧱 Backend component status: completed ✔️ Task has been completed type: feature 🛠 New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Extend the json-ld context Develop a RDF version of the JSON schema and example

3 participants