Closed pietercolpaert closed 8 months ago
Hello @pietercolpaert , Member dereferencing Please explain why the members needs to be dereference here? Thanks
Hello @pietercolpaert , Member dereferencing Please explain why the members needs to be dereference here? Thanks
Take for example the case of Marine Regions: https://marineregions.org/feed
In their implementation, they only foresee a list of members and when they changed. If you want the contents of the members, you need to dereference them. I’d like to add a property to make sure this can be indicated to the client that one extra HTTP request per member will be needed.
After the W3C TREE CG meeting of 2023-05-24:
dereferenceMember
boolean flag, we could also think about a deferencePath
that indicates a property path to a named node that needs to be dereferenced if you want to get to a complete member. The dereferenceMember flag could then be realized with an empty list as the object of tree:derefencePath
.tree:NamedGraphCollection
that adds explicit semantics to the named graph wrt the member extraction algorithm.Find all triples with the member URI as the subject and then repeat this for every named node and blank node that has been found in the object, except for subjects that have already been processed, and except for other members in the collection.
let Subjects = getMemberUris(triples);
members = [];
for (s of Subjects) {
members.push(extractMember(triples, s, processedSubjects, Subjects));
}
//Recursive function
function extractMember (T, s, processedSubjects, Subjects) {
processedSubjects.push(s); //This will prevent cycles
member = [];
for (t of T) {
if (t.subject.value == s) {
member.push(t);
if (t.object.termType !== 'Literal' && !processedSubjects.contains(t.object.value) && !Subjects.contains(t.object.value)) {
member.concat(extractMember (T, t.object.value,processedSubjects,Subjects);
}
}
}
return member;
}
I created an example where CBD and the SHACL shape would extract the same triples. Below is the data, but you can also play with it on the SHACL Playground.
@prefix ex: <http://example.org/>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
ex:resource1
ex:property1 [
ex:property2 ex:resource2
].
ex:resource2
ex:property3 "test".
@prefix ex: <http://example.org/>.
@prefix sh: <http://www.w3.org/ns/shacl#>.
ex:resource1Shape a sh:NodeShape;
sh:name "resource 1 shape";
sh:targetNode ex:resource1;
sh:property [
sh:name "property 1";
sh:path ex:property1;
sh:node ex:property2Shape
].
ex:property2Shape a sh:NodeShape;
sh:name "property 2 shape";
sh:property [
sh:name "property 2";
sh:path ex:property2
].
<http://example.org/resource1>
<http://example.org/property1> [
<http://example.org/property2> <http://example.org/resource2>
].
CBD stops after the triple with ex:resource2
as an object because named node objects are not traversed.
The SHACL requires understanding sh:property
, sh:path
, and sh:node
. Adding constraints would make things more complicated. I think they should be explicitly excluded from the logic.
From the TREE CG Call:
To motivate: if we choose CBD by default: what are the use cases for any specializations?
Over July-August, it became clear this the way to go forward on this issue. Will adapt the description a bit.
Has been published in the latest version
This rather large issue proposes to:
tree:member
: it refers to a topic, not to atree:Member
,Related: https://github.com/SEMICeu/LinkedDataEventStreams/issues/37
Pull request: #78
Follow the discussions and presentations on the mailing list: https://www.w3.org/community/treecg/