Hi Jeroen,

I am not 100% what the question is but I notice that you are using the variable ?thisNode, which has a pre-defined meaning in SWP. Could you try using another variable name, to exclude the possibility that this interacts with your query?

    http://uispin.org/ui.html#thisNode

HTH
Holger


On 11/08/2016 0:00, Jeroen Hamers wrote:
In EVN I'm trying to do the following:

I have a Graph with a skos:ConceptScheme schemeB which includes a graph with another skos:ConceptScheme schemeA. When I create a skos:Concept conceptB in schemeB, I want to automatically create another skos:Concept conceptA in schemeA with a generated URI, along with metadata and relations between the two concepts.

This works fine if I just use the URI that has been generated for conceptB and punt that inside schemeA, but I specifically do not want to use the same URI. Below I added the two versions of the *.ui.ttlx. The one that worked (using the same URI in another graph), and the one that didn't work (using BIND to generate a new URI).

version1.ui.ttlx ---The one that worked (using the same URI in another graph)---
# baseURI: http://evn.edustandaard.nl/autoupdate
# imports: http://topbraid.org/swa

@prefix arg: <http://spinrdf.org/arg#> .
@prefix default: <http://uispin.org/default#> .
@prefix evnui: <http://evn.topbraidlive.org/ui#> .
@prefix autoupdate: <http://evn.edustandaard.nl/autoupdate#> .
@prefix let: <http://uispin.org/let#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix teamwork: <http://topbraid.org/teamwork#> .
@prefix ui: <http://uispin.org/ui#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

autoupdate:example
  rdf:type teamwork:EditRule ;
  teamwork:ruleMayUpdate "true"^^xsd:boolean ;
  ui:prototype """
<ui:forEach ui:resultSet=\"{#
        SELECT ?subject
        WHERE {
            GRAPH ui:addedGraph {
                ?subject a skos:Concept .
                ?subject skos:prefLabel ?label .
            } .
        } }\">
    <ui:update ui:updateQuery=\"{!
            INSERT {
                GRAPH &lt;urn:x-evn-master:T01&gt; {
?spoConcept skos:broader &lt;http://purl.edustandaard.nl/concept/b913fda5-2ad9-11b2-80d1-d1868af30cdf&gt; .
                    ?spoConcept a skos:Concept .
                    ?spoConcept skos:prefLabel ?label .
?spoConcept skos:note &quot;Dit concept is automatisch toegevoegd door EVN.&quot; .
                    ?spoConcept skos:exactMatch ?subject .
                    ?spoConcept rdfs:isDefinedBy ?oo .
                }
            }
            WHERE {
                GRAPH ui:addedGraph {
                    ?thisNode skos:prefLabel ?label .
                    ?spoConcept skos:prefLabel ?label .
                    FILTER(?thisNode=?spoConcept)
                } .
                ?oo a owl:Ontology .
            } }\"/>
</ui:forEach>
"""^^ui:Literal ;
rdfs:comment "Executed after each change: inserts a dummy comment whenever a new skos;Concept has been created. This rule will not be executed after undo - because it is marked as teamwork:ruleMayUpdate."^^xsd:string ;
  rdfs:label "Example edit rule"^^xsd:string ;
  rdfs:subClassOf teamwork:EditRules ;
.

version2.ui.ttlx ---The one that didn't work (using BIND to generate a new URI)---
# baseURI: http://evn.edustandaard.nl/autoupdate
# imports: http://topbraid.org/swa

@prefix arg: <http://spinrdf.org/arg#> .
@prefix default: <http://uispin.org/default#> .
@prefix evnui: <http://evn.topbraidlive.org/ui#> .
@prefix autoupdate: <http://evn.edustandaard.nl/autoupdate#> .
@prefix let: <http://uispin.org/let#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix teamwork: <http://topbraid.org/teamwork#> .
@prefix ui: <http://uispin.org/ui#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

autoupdate:example
  rdf:type teamwork:EditRule ;
  teamwork:ruleMayUpdate "true"^^xsd:boolean ;
  ui:prototype """
<ui:forEach ui:resultSet=\"{#
        SELECT ?subject
        WHERE {
            GRAPH ui:addedGraph {
                ?subject a skos:Concept .
                ?subject skos:prefLabel ?label .
            } .
        } }\">
    <ui:update ui:updateQuery=\"{!
            INSERT {
                GRAPH &lt;urn:x-evn-master:T01&gt; {
?spoConcept skos:broader &lt;http://purl.edustandaard.nl/concept/b913fda5-2ad9-11b2-80d1-d1868af30cdf&gt; .
                    ?spoConcept a skos:Concept .
                    ?spoConcept skos:prefLabel ?label .
?spoConcept skos:note &quot;Dit concept is automatisch toegevoegd door EVN.&quot; .
                    ?spoConcept skos:exactMatch ?subject .
                    ?spoConcept rdfs:isDefinedBy ?oo .
                }
            }
            WHERE {
BIND( IRI(CONCAT("http://purl.edustandaard.nl/concept/",STRUUID())) AS ?spoConcept )
                GRAPH ui:addedGraph {
                    ?thisNode skos:prefLabel ?label .
                } .
                ?oo a owl:Ontology .
            } }\"/>
</ui:forEach>
"""^^ui:Literal ;
rdfs:comment "Executed after each change: inserts a dummy comment whenever a new skos;Concept has been created. This rule will not be executed after undo - because it is marked as teamwork:ruleMayUpdate."^^xsd:string ;
  rdfs:label "Example edit rule"^^xsd:string ;
  rdfs:subClassOf teamwork:EditRules ;
.
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
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 [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Group "TopBraid 
Suite Users", the topics of which include the TopBraid Suite family of products and 
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
--- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to