-
Notifications
You must be signed in to change notification settings - Fork 6
Arbitrary JSON-LD for topics in API #291
Comments
Let's think about how we want to use named graphs. We can potentially give any arbitrary set of triples a URI so that it can be tracked more easily for provenance, versioning, access control, whatever. So, if I understood correctly, you are proposing that we create a named graph for each project topic, which would include all statements that constitute the structured data for the topic, outside of the administrative stuff we need to just make WN work. That makes sense to me. I don't think we want to use the same URI to identify the named graph as we use to identify the topic, though. Would it perhaps make sense to have, rather than a named graph per project topic, a single named graph for all the structured data for all the project's topics? This would still give them their own "space". So, something like: {
"@context": {
"url": "@id",
"structuredData": "@graph"
},
"url": "http://workingnotes.org/projects/emma/data/",
"structuredData": {
"@context": {
"color": "http://example.org/v#color"
},
"@id": "http://workingnotes.org/projects/emma/topics/4/",
"color": "green"
}
} |
👍 on having separate named graphs for WN and the project. |
Here's one way to get multiple named graphs. hmm. [
{
"@context": {
"name": "http://workingnotes.org/v#name"
},
"@id": "http://workingnotes.org/",
"@graph": {
"@id": "http://workingnotes.org/projects/emma/topics/4/",
"name": "asdf"
}
},
{
"@context": {
"color": "http://workingnotes.org/projects/emma/v#color"
},
"@id": "http://workingnotes.org/projects/emma",
"@graph": {
"@id": "http://workingnotes.org/projects/emma/topics/4/",
"color": "green"
}
}
] |
That's not so bad… |
And, keeping with our hydra definitions, the Make sense? But what do the payloads look like for PUTting topics shaped like this? How can we make them self-describing? |
json-ld/json-ld.org#398 would help with this too |
Or maybe a topic should be split into two resources. A client would only be able to do HTTP operations on whichever one of the resources (project-specific or site-wide) that they were dealing with. We could have a "virtual" resource that combines the two in #291 (comment). These could then have some sort of |
This is real deal stuff |
Let's say that these two split resources are:
How should we express that (3) is the "combination" of (1) and (2)? A couple possibilities: This isn't my comfort zone, so they may not make sense. |
In the end, it might be something like: Graph (1): <http://workingnotes.org/projects/emma/topics/1/wn> <http://workingnotes.org/v#preferredName> "Alexander Berkman" Graph (2): <http://workingnotes.org/projects/emma/topics/1/emma> <http://workingnotes.org/emma/v#customProperty> "customValue" Graph (3): <http://workingnotes.org/projects/emma/topics/1/>
owl:unionOf (
<http://workingnotes.org/projects/emma/topics/1/wn>
<http://workingnotes.org/projects/emma/topics/1/emma>
);
<http://workingnotes.org/v#preferredName> "Alexander Berkman";
<http://workingnotes.org/emma/v#customProperty> "customValue". Does that work? |
I think I prefer |
And yes, other than the choice of term I like this way of modeling it. |
I found it searching for "aspect" on http://lov.okfn.org. OK, great! So then it would be: <http://workingnotes.org/projects/emma/topics/1/>
vaem:hasAspect
<http://workingnotes.org/projects/emma/topics/1/wn>,
<http://workingnotes.org/projects/emma/topics/1/emma>;
<http://workingnotes.org/v#preferredName> "Alexander Berkman";
<http://workingnotes.org/emma/v#customProperty> "customValue". |
I think |
How should we represent this in Topics' JSON-LD representations?
I'll start from this example topic:
Let's say that someone wants to add a triple whose subject is this topic, predicate is
http://example.org/v#color
and object is the string literal"green"
.The simplest way to do this would be to just extend the API's representation of the topic:
However, I think it makes sense to fence extra properties (i.e. not ones built in to Editors' Notes) into their own namespace, with its own context. That might look something like this:
In this case, we have to repeat
@id
to set a subject for the statements in the@graph
. That results in the following nquad:<http://workingnotes.org/projects/emma/topics/4/> <http://example.org/v#color> "green" <http://workingnotes.org/projects/emma/topics/4/> .
Is that nonsensical, defining an RDF object as the subject of its own named graph?
If json-ld/json-ld.org#246 were a reality, we could set
structuredData
in the@context
to be@index
rather than@graph
, making it a semantically meaningless grouping. However, that's not possible with the current JSON-LD standard.I still think this second approach makes the most sense, because it makes it clear which properties are user-defined and which are EN-defined. It would be nice to be able to say, in effect: "here's your own JSON-LD space to do whatever you want."
Any other ideas?
The text was updated successfully, but these errors were encountered: