EDG INSERT/CONSTRUCT with parameter provided by user

22 views
Skip to first unread message

Kasia Kryczka

unread,
Jul 7, 2023, 4:04:49 AM7/7/23
to TopBraid Suite Users
Hi all,

I want to create a query where the user will provide the uri in the insert part.
So the user uses a query from sparql library and provides URI in the parameter.

CONSTRUCT{
?provideUri ?p ?result
  }
Select *
WHERE {
  SELECT ?cS (GROUP_CONCAT(?pTY; SEPARATOR=', ') AS ?result) ?provideUri{
  BIND(URI($provideUri) as ?provideUri )
  BIND($PPTFilter as ?PPTFilter)
  BIND($cFilter as ?cFilter )
  BIND(teamwork:currentMasterGraph() as ?cGraph)
 
GRAPH ?cGraph
  {?cGraph owl:imports ?import}
 
  GRAPH ?import{
        ?d a skos:cS.
        ?d skos:hasTopConcept ?cS.
        ?PPT skos:broader ?cS.
        ?PPT ontology:PPT ?pTY .
          }

 FILTER(CONTAINS(STR(?PPT), ?PPTFilter) ||
      (CONTAINS(STR(?cS), ?cFilter))  )
   
  .
   
  }GROUP BY ?cS ?provideUri }

  BIND($PPTFilter as ?PPTFilter)
  BIND($cFilter as ?cFilter ) these 2 are used as string and they work fine 

but I have a problem with the ?provideUri 

 I don't know what type to use should it be string?
when I BIND manually <http:// > it works but when I try to do it by the parameter inserted is shows nothing.

Is it possible to have a solution when the user insert the URI?



Parameters:
provideUri:
Optional
booleandatedateTimedecimalintegerstringlangStringasset of type...




Parameters for SPARQL library query "test2"

Please fill in the values for the query parameters.

provideUri2


Br,

Kasia

Richard Cyganiak

unread,
Jul 7, 2023, 4:09:33 AM7/7/23
to topbrai...@googlegroups.com
Hi Kasia,

I’m not 100% sure, but I think the two variables need to be different in clauses like

    BIND(URI($provideUri) as ?provideUri )

Both are called “provideUri” here, and I think that is why the clause has no effect.

Richard



--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@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-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/d6b7b790-7df7-4c07-b5d0-f0a1ed22f4adn%40googlegroups.com.

Kasia Kryczka

unread,
Jul 7, 2023, 4:27:48 AM7/7/23
to TopBraid Suite Users
Hi,

well of course it worked :) 

Thank you !
Reply all
Reply to author
Forward
0 new messages