Query Named Graph including imports

37 views
Skip to first unread message

Richard Nagelmaeker

unread,
Mar 24, 2022, 8:42:29 AM3/24/22
to TopBraid Suite Users
Hi All,

In earlier versions of EDG, we used Sparqlmotion to query a named graph including all of it's imports. 
In recent versions of EDG, SPARQLMotion is removed. So we wonder how we can query a named graph including it's imports?

The query is sent or triggered by an application and the response has to be in RDF/XML.

Anybody a solution for this?

Cheers,

Richard

Richard Cyganiak

unread,
Mar 24, 2022, 9:55:18 AM3/24/22
to topbraid-users list
Hi Richard,

What do you mean by “query” here? Are you talking about something like a SPARQL CONSTRUCT query? Or do you simply want to return a graph with all its imports in RDF/XML format?

Richard C



--
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/659d8c50-6aa7-430f-b1d3-2729abf2a2een%40googlegroups.com.

Richard Nagelmaeker

unread,
Mar 25, 2022, 12:06:32 PM3/25/22
to TopBraid Suite Users
Hi Richard,

Thank you for your question. I 've got a solution I think, see the query below:

construct
{
     ?s2 owl:imports ?o2 .
  }
where
{
  graph ?o
  {
    ?s2 owl:imports ?o2 .
  }
 
  {
SELECT ?o
{
  graph <http://some-named-graph/>
{
 ?s owl:imports ?o .
  }
}
  }}

This isn't the final query, but it does the thing I need, query all graphs in the imports.

Regards,

Richard

Richard Cyganiak

unread,
Mar 25, 2022, 12:25:30 PM3/25/22
to topbraid-users list
Hi Richard,

Here are some SPARQL queries that might be helpful:

Select all direct imports of <http://some-named-graph>:

    SELECT ?import
    WHERE {
        GRAPH  <http://some-named-graph> {
             <http://some-named-graph> owl:imports ?import
        }
    }

Select all direct and indirect imports of <http://some-named-graph>:

    SELECT ?import
    WHERE {
        BIND (ui:graphWithImports(<urn:x-evn-master:t1>) AS ?graph)
        GRAPH ?graph {
            <urn:x-evn-master:t1> owl:imports+ ?import
        }
    }

Return ALL triples from the graph <http://some-named-graph> as well as all triples from any directly or indirectly imported graphs:

    CONSTRUCT {
        ?s ?p ?o
    }
    WHERE {
        BIND (ui:graphWithImports(<http://some-named-graph>) AS ?graph)
        GRAPH ?graph {
            ?s ?p ?o
        }
    }

Return only the owl:imports triples from the previous query:

    CONSTRUCT {
        ?s owl:imports ?o
    }
    WHERE {
        BIND (ui:graphWithImports(<http://some-named-graph>) AS ?graph)
        GRAPH ?graph {
            ?s owl:imports ?o
        }
    }

Hope that helps,
Richard C


Nagelmaeker, Richard (R.R.M.)

unread,
Mar 28, 2022, 2:52:47 AM3/28/22
to topbraid-users list

Hi Richard,

 

Thanks for all the suggestions. Will use the ui:graphWithImports function to get the list of named graphs.

 

Thanks,

 

Richard

--
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/o-wNOKwdt80/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/D3F62F95-1692-4E45-B7A2-70E6DBD8281E%40topquadrant.com.

------------------------- Disclaimer ----------------------------
De informatie verzonden met dit e-mailbericht (en bijlagen) is uitsluitend bestemd voor de geadresseerde(n) en zij die van de geadresseerde(n) toestemming kregen dit bericht te lezen.
Kennisneming door anderen is niet toegestaan.
De informatie in dit e-mailbericht (en bijlagen) kan vertrouwelijk van aard zijn en binnen het bereik van een geheimhoudingsplicht en/of een verschoningsrecht vallen.
Indien dit e-mailbericht niet voor u bestemd is, wordt u verzocht de afzender daarover onmiddellijk te informeren en het e-mailbericht (en bijlagen) te vernietigen.
Conform het beveiligingsbeleid van de Politie wordt e-mail van en naar de politie gecontroleerd op virussen, spam en phishing en moet deze e-mail voldoen aan de voor de overheid verplichte mailbeveiligingsstandaarden die zijn vastgesteld door het Forum Standaardisatie.
Mail die niet voldoet aan het beveiligingsbeleid kan worden geblokkeerd waardoor deze de geadresseerde niet bereikt. De geadresseerde wordt hiervan niet in kennis gesteld.
---------------------------------------------------------------------
The information sent in this E-mail message (including any attachments) is exclusively intended for the individual(s) to whom it is addressed and for the individual(s) who has/have had permission from the recipient(s) to read this message.
Access by others is not permitted.
The information in this E-mail message (including any attachments) may be of a confidential nature and may form part of the duty of confidentiality and/or the right of non-disclosure.
If you have received this E-mail message in error, please notify the sender without delay and delete the E-mail message (including any attachments).
In conformity with the security policy of the Police, E-mails from and to the Police are checked for viruses, spam and phishing and this E-mail must meet the standards of the government-imposed E-mail security as set by the Standardization Forum.
Any E-mail failing to meet said security policy may be blocked as a result of which it will not reach the intended recipient. The recipient concerned will not be notified.
---------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages