-
Notifications
You must be signed in to change notification settings - Fork 8
Polyglot Modeling #19
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
Comments
This was discussed during today's call: https://json-ld.org/minutes/2022-06-22/. |
On the topic of semantic polyglot mechanisms (i.e. not dependent upon syntactic, "irrelevant" idiosyncrasies), I'd like to add Target Vocabulary Maps as a reference. It is focused upon a simpler way of getting data using "Ontology A" into data using "Ontology B" than using OWL reasoners. This mechanism instead maps the used terms from A to B, taking some variances such as granularity into account. The relevance here is mostly about contrast: TVMs should have nothing to do with syntax, but the form and meaning of the information expressed. Wherein, I'd suggest, lie the real and hard problems of interoperability. My worry is that parts of the problems tackled in the efforts listed in this issue stem from a failure to separate syntactical differences (which should be about "typography" / editorial ergonomics), from semantic differences (the topic of the role, denotation and scope of identities, and different perspectives on temporality, generality, granularity). I believe we must both recognize that the latter are reasonably orthogonal to syntax — but also that it is much harder to separate them in practise (since syntaxes and tools are all we have). Therefore diligence is required to keep them distinct. One of the most challenging things here is the (quite reasonable) motivation to package and insulate specific solutions (any given "simple REST API" is such a thing). I think JSON-LD in essence is an attempt to bridge those isolated solutions and the Semantic Web. By extension, so is LinkML (I'd say that that, through extension, is even more "tooling-oriented"). However, neither of these really attempt to unify the resulting combinatorial knowledge graphs. They "just" result in URI:s for all the terms. That is a good start (I'd say a necessity of sorts), but without the Semantic Layer Cake —or something simpler— we've actually gotten nowhere in terms of combining the graphs. The resulting "triple soup" becomes unintelligible in its proliferation of terms. That is a hard problem. Syntactic differences and contextual "walls" are just symptoms and mitigations. Methods for guiding or restricting forms of expression may be an aid. Those are commonly realized by structures such as enumerations and schema restrictions within or upon term definitions, either tied to vocabulary terms, or application ("context" or "profiles"), or both ("application vocabularies"). I believe we need to seek a fruitful, simplified convergence here rather than to attempt to seek "independence", which actually introduces, indirected, multilayered dependence. That, however, is reasonably not the task of YAML-LD. What I do believe is that is is up to YAML-LD not to further the divide by isolation, by which I mean it should avoid invention of solutions that only work within its particular syntax. Or, if that is too alluring (well, valuable), we must learn from that and attempt to generalize its solution beyond the syntax. Of course, that position relies upon the assumption that a fundamental RDF-based substrate is of value, and that RDF vocabularies themselves can be practically used for interoperability. (An opposite position would be that the type system of a particular language (say Haskell) is sufficient and the actual limit beyond which no practical interoperability can be achieved. Even REST API:s will, by and large, be divided by application, mere simplified—even crass and ephemeral—surfaces for certain interaction with a system realized through its internal, isolated application complexity.) |
I'd describe JSON-LD as doing purely syntactic transformations. There's the intention of mapping to something more semantic, but that's realized not by JSON-LD but by the |
This issue was discussed in today's meeting. |
This comment was marked as resolved.
This comment was marked as resolved.
I took care of it. |
Regarding the comment of @VladimirAlexiev about data models defined at smart data models. It is true that there is a yaml version of all schemas and that this version is core for the development of many digital assets. But it is also true that the original single-source-of-truth is a json schema. Why? possibly both are valid solutions, we just started with json schema and there are many libraries for validation. (maybe there are also libraries for yaml) |
@niklasl I've now read your SWIB 2019 slides and I like what you say on p23
This reminds me strongly of tricks described here:
Going to slide 26: whereas you "bastardize" PCA to say schema:isbn
owl:propertyChainAxiom (
[ rdfs:subPropertyOf bf:identifiedBy ; rdfs:range bf:Isbn ]
rdf:value
) I would represent it with a dedicated construct eg :bf_identifiedBy__schema_isbn a ptop:PropChainType1;
ptop:premise1 bf:identifiedBy;
ptop:type1 bf:Isbn;
prop:premise2 rdf:value;
ptop:conclusion schema:isbn. And then implement with a rule like this:
I did plenty of GLAM work in the past, and recently applied the above constructs to a RiCO case, using PROV patterns: Rolification vs Qualification: ICA-EGAD/RiC-O#67 (comment) |
Since it was mentioned in the (edited) #19 (comment) by @VladimirAlexiev: |
@simontaurus thanks! It is great to see new products and technologies built with LD and even more so with YAML. Would you want to use a Convenience Context (with dollar signs or without them) to avoid the need to escape @-keywords except |
@anatoly-scherbakov: In general we want to keep keywords in 'instance' JSON-documents (=> property names in schemas) strict {
"@context": {
"schema": "http://schema.org/",
"name": "schema:name",
"type": "@type"
},
"title": "Person",
"type": "object",
"properties": {
"type": {
"type": "string",
"default": "schema:Person",
},
"name": {
"type": "string",
"description": "First and Last name",
}
}
} translates smoothly to python (pydantic) via https://github.com/koxudaxi/datamodel-code-generator: class Person(BaseModel):
type: Optional[str] = "schema:Person"
name: Optional[str] = None
"""First and Last name""" what would not be the case if we use I would prefere both JSON-LD and JSON-SCHEMA didn't introduce special char keywords |
@simontaurus wrote:
That is really neat; very powerful. Keep going! |
@simontaurus thanks for the info! I am a frequent user of If we could define aliases usable inside contexts then writing contexts in YAML-LD would've been much more feasible. Currently, author has to live with a lot of quoting due to the Originally we thought we'd replace each |
@simontaurus hi. In Italy, all agencies are using the https://datatracker.ietf.org/doc/draft-polli-restapi-ld-keywords/03/ to tie Json schema and jsonld. This spec was designed to avoid some issues arising from using potentially protected keywords in json-schema. This is done including json-ld content inside specific keywords, so that no conflicts with current or future json-schema versions arise. |
@simontaurus here you can see a preliminary swagger editor that interprets these keywords and renders the associate semantic resources https://italia.github.io/swagger-editor/ |
@msporny wrote:
Many thank - glad you see some potential in this approach! @anatoly-scherbakov wrote:
After getting pyodide running there's now also a python playground. From pydantic it's also straight forward to generate JSON- / OpenAPI-Schemas, especially via FastAPI @ioggstream : Thanks for sharing. Great feature to have annotated OpenAPI schemas with rendering support in Swagger-UI! |
Hello @VladimirAlexiev, you've got the wrong user tag after Semantic Treehouse. Commenting to help you find the right Wouter van den Berg :) |
Hi @simontaurus,
It seems a very cool playground! I'll probably reuse part of it for LD-keywords :) Maybe we could share some library code since it seems to me that the main difference is that OO-LD just puts the
The issues are:
After discussing with JSON-SCHEMA and JSON-LD folks (see json-ld/json-ld.org#612 (comment)) we identified this solution.
I'd avoid using externalDocs for specific use cases. |
@ioggstream wrote:
I would very much appreciate that! @ioggstream wrote:
Regarding the context you are totally right. But in addition we also want to provide some extension like multi-context-mapping, multilanguange support and, most important, annotation for the range of (object) properties which are only validated syntactically as IRIs in JSON-SCHEMA. E.g. a "@context":
schema: http://schema.org/
works_for: schema:worksFor
type: "@type"
id: "@id"
demo: https://oo-ld.github.io/demo/
"@graph":
- id: demo:person
type: schema:Person
works_for: demo:organization
- id: demo:organization
type: schema:Organization can be expressed with
"@context":
schema: http://schema.org/
works_for: schema:worksFor
type: "@type"
"$id": Person.schema.json
title: Person
type: object
properties:
type:
type: string
const: schema:Person
works_for:
type: string
x-oold-range:
allOf:
"$ref": Organization.schema.json
description: IRI pointing to an instance of schema:Organization
"@context":
schema: http://schema.org/
type: "@type"
"$id": Organization.schema.json
title: Organization
type: object
properties:
type:
type: string
const: schema:Organization which would also translate to OWL schema:Person rdf:type owl:Class ;
rdfs:subClassOf [
rdf:type owl:Restriction ;
owl:onProperty schema:works_for ;
owl:someValuesFrom schema:Organization ;
] . and SHACL schema:Person Shape
sh:NodeShape ;
sh:targetClass ex:Person ;
sh:property [
sh:path schema:works_for ;
sh:class schema:Organization ;
] ; but would allow to extend existing JSON-SCHEMA based tools to make use of this annoations, e.g. in order to provide autogenerated autocomplete fields with the option to create a missing instance ad-hoc with the specified schema or to patch pythons |
Had a very interesting chat with @Michiel-s, @WvandenBerg (TNO), @robert-david, @skarampatakis, @amelak9 (SWC), @ivanov-petar (Ontotext) on collaboration for Semantic Vocabulary Hubs for Dataspaces. |
Uh oh!
There was an error while loading. Please reload this page.
WHO: As an information architect
WHAT: I want data modeling language(s) independent of technical artefacts
WHY: So that:
For efficient RDF modeling, you need to define multiple related artefacts:
Thus, many people have expressed the desire to define a unified or "technology independent" modeling language.
Many communities like to have a LD expression of their data, but mostly care about defining the data with JSON schema. Efforts to marry JSON Schema with JSON-LD contexts have been undertaken in:
w3c-ccg
@OR13 @nissimsan @mspornyExamples of polyglot frameworks include the following (many but not all are YAML-based):
Eg see Dragon: Schema Integration at Uber Scale, US Semantic Technologies Symposium, March 2020, cached PDF. YAML schema examples start slide 42
respec
(see examples: test.yml, rendered test.html; previews, security/vocabulary.yml)YAML-LD should not take over these modeling-framework efforts, but should show how they can be used together, show archetypical examples, and maybe make a comparison.
Even if no Modeling requirements make it into any YAML-LD spec, this git repo could serve as a "meeting place" for people working on these topics, potentially resulting in some unification.
The text was updated successfully, but these errors were encountered: