Skip to content
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

multiple per-profile graphs (in JSON-LD and Trig) #119

Closed
VladimirAlexiev opened this issue Oct 26, 2024 · 3 comments
Closed

multiple per-profile graphs (in JSON-LD and Trig) #119

VladimirAlexiev opened this issue Oct 26, 2024 · 3 comments
Assignees
Labels
graph Pertains to Named graphs instance Pertains to instance data profile Pertains to profiles, packages (AP) spec Need to also change some standard or specification

Comments

@VladimirAlexiev
Copy link
Collaborator

VladimirAlexiev commented Oct 26, 2024

@griddigit-ci in

need to be able to exchange instance data from different profiles in one instance file and be able to know which attribute is in which part of the data. Maybe using graphs in JSONLD or another trick. Theoretically I should be able to put all data in one JSONLD EQ, SSH, TP, SV and at the receiving end I should be able to only read TP from the JSONLD if I want to do that

  • Every CIM triple lives in a Model, which is a named graph.
  • So far I've only seen instance files that have exactly 1 model, and from the file naming: that model carries only 1 profile (is that correct)?
  • There is no problem to concat several models in 1 file (in CIM XML, Trig or JSONLD), as soon as the standard allows it. These models can carry different profiles
  • But do you need to intermix several profiles in 1 model? Then you need to add extra props to capture a "graph-subgraph" relation

While thinking about the relation between models and profiles:

  • Does every triple live in 1 profile only?
  • I don't think that's the case since we have ontology terms repeated in multiple profiles (up to 19 times if I remember correctly)
  • So if you separate profiles by graph, are you ok with having duplicate triples resulting from different quads?
  • To give an example: if a resource's rdf:type and MRID are stated in 10 profiles and you put them in 10 named graphs, you'll end up with 10+10 duplicate triples
  • This will require careful graph selection in queries, or the need to use DISTINCT in many places, thus making queries more complex and expensive
  • You don't want to end up with something like this ERA problem: lots of data duplication (Tunnels) Interoperable-data/ERA-Ontology-3.1.0#117: all triples about the Gotthard-Basistunnel (53km) are repeated 22 times
@VladimirAlexiev VladimirAlexiev added profile Pertains to profiles, packages (AP) instance Pertains to instance data graph Pertains to Named graphs labels Oct 26, 2024
@Sveino
Copy link
Owner

Sveino commented Oct 31, 2024

Let us not mix up the semantic and the syntax. In general a dataset/graph is represented as one instance file. The exception is DifferenceSet. A dataset can conform to multiple profiles. If we want to exchange multiple dataset we can either use rdfg:Graph or compressed file.

@VladimirAlexiev
Copy link
Collaborator Author

  • Vladimir asked: can the base Dataset of a DifferenceModel include data from one or multiple profiles?
  • @Sveino answered: the base should always be single Dataset, and it can include data from multiple profiles
  • Vladimir: I agree because if you want to make a small change to a complete grid model, that model will include data from multiple profiles.

@VladimirAlexiev VladimirAlexiev changed the title multiple per-profile graphs in JSON-LD? multiple per-profile graphs (in JSON-LD and Trig) Dec 28, 2024
@VladimirAlexiev
Copy link
Collaborator Author

I've reread this and @griddigit-ci's question was different: can I extract only a single profile from a model?

  • Currently we have named-graph per-model
  • If you want to delineate statements from different profiles, then we need to use named-graph per-model-per-profile, and a "subgraph" relation (md:DependentOn, dct:requires or rdfg:subGraphOf

In this trig example, <full-model> has no statements of its own (but of course it could have such statements):

@prefix rdfg: <http://www.w3.org/2004/03/trix/rdfg-1/>.

graph <full-model> {
  <full-model> a dcat:Dataset, rdfg:Graph;
    dct:conformsTo <EQ>, <SSH>.
  # md:DependentOn <EQ-model>, <SSH-model> # OLD
  dct:requires <EQ-model>, <SSH-model>. # NEW
}
graph <EQ-model> {
  <EQ-model> a dcat:Dataset, rdfg:Graph;
    dct:conformsTo <EQ>;
    rdfg:subGraphOf <full-model>. # OPTIONAL
  <resource> cim:IdentifiedObject.name "name"
}
graph <SSH-model> {
  <SSH-model> a dcat:Dataset, rdfg:Graph;
    dct:conformsTo <SSH>;
    rdfg:subGraphOf <full-model>. # OPTIONAL
  <resource> cim:SomeSshProperty "1.2"^^xsd:float
}

This can be converted to a single JSON-LD file and will carry the 3 models without any problem.

I'll resolve this and add label spec. If you disagree, reopen with comment

@VladimirAlexiev VladimirAlexiev added the spec Need to also change some standard or specification label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graph Pertains to Named graphs instance Pertains to instance data profile Pertains to profiles, packages (AP) spec Need to also change some standard or specification
Projects
None yet
Development

No branches or pull requests

3 participants