Hi Tim,

> On 3 Oct 2024, at 5:49 AM, Tim Bridwell <timbridw...@gmail.com> wrote:
> 
> Looking to use TB 7.8 sparql endpoint to construct a ttl file from .tch for 
> inserting into another .tch file for a different environment (ex. dev to 
> test).
> 
> I am able to build an satisfactory CONSTRUCT query, and get the data I need. 
> However, in the data are duplicate blank node triples:
> 
> <urn:x-change:2024-10-02T19-47-36.847Zm149843-17f82ce1-07a8-427d-8492-10a87eb28814>
>         rdf:type          teamwork:Change;
>         rdfs:comment      "Created Article \"test\"";
>         dcterms:created   "2024-10-02T19:47:36.847Z"^^xsd:dateTime;
>         sioc:has_creator  <urn:x-tb-users:xxxxx>;
>         teamwork:added    [] ;
>         teamwork:added    [ teamwork:object     <#Article>;
>                             teamwork:predicate  rdf:type;
>                             teamwork:subject    <#test>
>                           ];
> teamwork:added    [ teamwork:object     <#Article>;
>                             teamwork:predicate  rdf:type;
>                             teamwork:subject    <#test>
>                           ];
> teamwork:added    [ teamwork:object     <#Article>;
>                             teamwork:predicate  rdf:type;
>                             teamwork:subject    <#test>
>                           ];
> teamwork:added    [ teamwork:object     <#Article>;
>                             teamwork:predicate  rdf:type;
>                             teamwork:subject    <#test>
>                           ];
> etc.
> 
> Other than the duplicates, the remainder ttl is exactly what I need for an 
> INSERT DATA query.
> 
> Construct query:
> 
> CONSTRUCT { ?s ?a ?o .
>   ?s teamwork:tag      <urn:x-tags:xxx> .
>     ?s ?p [ teamwork:object ?y ;
>      teamwork:predicate ?b ;
>       teamwork:subject ?d ] . }
> WHERE {
>   ?s teamwork:tag      <urn:x-tags:xxx> .
>   ?s ?a ?o .
>   ?s ?p [teamwork:object ?y ;
>      teamwork:predicate ?b ;
>      teamwork:subject ?d] .
> }
> 

my understanding is that this would produce multiple blank nodes for each match 
of the triple ?s ?a ?o.

Can be break this into two separate CONSTRUCTs where you first do all other 
triples including the ?a and then the loop over the subject/predicate/object 
bnodes?

Another strategy may be to reuse the blank nodes, i.e. avoid using [ ... ] 
syntax in the CONSTRUCT clause, as that would produce fresh bnodes each time. 
Instead try

?s ?p ?t .
?t teamwork:subject ?d .
?t teamwork:predicate ?b .
?t teamwork:object ?y .

and then use ?t in the CONSTRUCT.

(These are just some untested ideas, HTH).

Holger


> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> --- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to topbraid-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/d4abdeee-363a-459b-b995-332b32bf01c5n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/d4abdeee-363a-459b-b995-332b32bf01c5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to topbraid-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/27B3E826-98AC-4AF4-B86F-CC19DD321FEB%40topquadrant.com.

Reply via email to