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
The Member extraction algorithm #71
Comments
tree:member
points to the primary topic of a member, not to the member itself
Hello @pietercolpaert , |
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:
The base member extraction algorithmFind 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. Data@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". Shape@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
]. Extract<http://example.org/resource1>
<http://example.org/property1> [
<http://example.org/property2> <http://example.org/resource2>
]. CBDCBD stops after the triple with ShapeThe SHACL requires understanding |
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: SEMICeu/LinkedDataEventStreams#37
Pull request: #78
Follow the discussions and presentations on the mailing list: https://www.w3.org/community/treecg/
The text was updated successfully, but these errors were encountered: