Hi ,

I would like to add a simple comment to all graphs their object of a type 
class and instaces and then remove so it appears in the change history.


graph.select(`PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX teamwork: <http://topbraid.org/teamwork#>
    PREFIX edg: <http://edg.topbraid.solutions/model/>
    PREFIX bosch-metadata-ontology: 
<http://semantic.bosch.com/bosch-metadata-ontology-v1/> 
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX ontologyprojects: 
<http://teamwork.topbraidlive.org/ontologyprojects#> 
PREFIX spif: <http://spinrdf.org/spif#>

  
    SELECT DISTINCT ?masterGs ?class ?instance 
WHERE {
    {
        rdf:nil teamwork:readableGraphsUnderTeamControl ?masterGs.
        GRAPH ?masterGs {
            ?s a ontologyprojects:Ontology;
               edg:subjectArea ?subArea.
      OPTIONAL{?class a owl:Class.}
      OPTIONAL{?instance a ?class}
            OPTIONAL { ?masterGs bosch-metadata-ontology:securityClass 
?SecClass }
            FILTER (
                ?SecClass = bosch-metadata-ontology:CSC0 || 
                ?SecClass = bosch-metadata-ontology:CSC1
            )
            FILTER (
                str(?subArea) != 'test' &&
                str(?subArea) != 'test2' &&
                str(?subArea) != 'test3' &&
                str(?subArea) != 'test4'
            )
        }
  }}
 

`).bindings.forEach(b => {
    let masterGraph =b.masterGs;
    let masterClass = b.class;
    let instance = b.instance;
// console.log (b.masterGs);
// console.log (b.class);
// console.log (b.instance);

 graph.transaction(b.masterGs, 'Adding something', () => {
        // Create node references
        let graphNode = graph.namedNode(b.masterGs);
        let classNode = graph.namedNode(b.class);
        let instanceNode = b.instance ? graph.namedNode(b.instance) : null;

        // Add comments or other properties
         graphNode.add('http://www.w3.org/2000/01/rdf-schema#comment', "Added 
to graph");
    classNode.add('http://www.w3.org/2000/01/rdf-schema#comment', "Added to 
class");
    if (instanceNode) {
        instanceNode.add('http://www.w3.org/2000/01/rdf-schema#comment', "Added 
to instance");
    }
    });
});  
I created sth like this but unfortunately this doesn't work. Could you help 
me with that ?

Br,

Kasia

-- 
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/564a8afe-4ce2-4e46-a39e-86086cd0d824n%40googlegroups.com.

Reply via email to