linked-art / linked.art

Development of a specification for linked data in museums, using existing ontologies and frameworks to build usable, understandable APIs
https://linked.art/
Other
88 stars 12 forks source link

Check json-ld context for camel case properties #506

Open azaroth42 opened 1 year ago

azaroth42 commented 1 year ago

and other errors

bluebinary commented 1 year ago

Here are the current keys that have camel-cased properties:

 - subState
 - subState_of
 - hasTopConcept
 - topConceptOf
 - inScheme

Found via the following Python script:

#!/usr/bin/python3

import json
import re

context = "/path/to/linked-art.json"

with open(context, "r") as handle:
    if data := json.load(handle):
        data = data["@context"]

        for key in data:
            if re.match(r"[a-z]{1,}[A-Z]{1}", key):  # check if an upper-case character follows some lower case
                print(" - %s" % (key))

There may be some other property names that fall outside the pattern, but these were the ones that caught initial attention.

azaroth42 commented 2 months ago

Fixed :)

bluebinary commented 3 weeks ago

I noticed that subState and subState_of are still present in the latest version of the published Linked.Art context: https://linked.art/ns/v1/linked-art.json

Are these two properties needed for the 1.0 release, if not could we propose to remove them, or at least to rename them to sub_state and sub_state_of for consistency with the naming convention used for all of the other properties, or is renaming these two properties impossible due to some pre-existing use that would be too complex to change?

bluebinary commented 3 weeks ago

Separately I noticed that hasTopConcept, topConceptOf and inScheme have been completely removed from the Linked.Art context document rather than being renamed; there are no remaining references to the underlaying schema properties that they mapped to, which were: skos:hasTopConcept, skos:topConceptOf and skos:inScheme respectively.

As I'm not sure that their removal was explicitly documented elsewhere, I just wanted to note it here for future reference.

azaroth42 commented 3 weeks ago

Fix subState subState_of to has_sub_state and is_sub_state_of

azaroth42 commented 3 weeks ago

Recipe for concept usage, and discussion about extensions for extra-CRM details