You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@atomgraph.com> on 2020/11/08 23:13:13 UTC
Re: Slow property graph query
Hi,
still interested to know why this query performs so poorly in Fuseki.
What I thought was an alternative is actually not equivalent.
On Sun, Oct 4, 2020 at 8:39 PM Martynas Jusevičius
<ma...@atomgraph.com> wrote:
>
> Hi,
>
> The following (generated) query takes 1 minute to execute over a
> dataset of 175862 quads in Fuseki 3.16.0. Isn't that slow?
>
> If I remove the SAMPLE and the last OPTIONAL, it executes immediately.
>
> PREFIX dct: <http://purl.org/dc/terms/>
> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> PREFIX sioc: <http://rdfs.org/sioc/ns#>
>
> SELECT DISTINCT ?thing (COUNT(DISTINCT ?child) AS
> ?countchildd14aAdAbDbAbA) (SAMPLE(?labelthingd14aAdAbDbAbA) AS
> ?labelthingd14aAdAbDbAbAsample)
> WHERE
> { GRAPH ?childGraph
> { { ?child sioc:has_parent <https://localhost:4443/products/> }
> UNION
> { ?child sioc:has_container <https://localhost:4443/products/> }
> ?child a ?Type
> OPTIONAL
> { ?child dct:title ?title }
> OPTIONAL
> { ?child foaf:primaryTopic ?thing }
> }
> OPTIONAL
> { { ?thing
> (((((((<http://www.w3.org/2000/01/rdf-schema#label>|<http://purl.org/dc/elements/1.1/title>)|dct:title)|foaf:name)|foaf:givenName)|foaf:familyName)|sioc:name)|<http://www.w3.org/2004/02/skos/core#prefLabel>)|sioc:content
> ?labelthingd14aAdAbDbAbA }
> UNION
> { GRAPH ?labelthingd14aAdAbDbAbAgraph
> { ?thing
> (((((((<http://www.w3.org/2000/01/rdf-schema#label>|<http://purl.org/dc/elements/1.1/title>)|dct:title)|foaf:name)|foaf:givenName)|foaf:familyName)|sioc:name)|<http://www.w3.org/2004/02/skos/core#prefLabel>)|sioc:content
> ?labelthingd14aAdAbDbAbA }
> }
> }
> }
> GROUP BY ?thing
> ORDER BY DESC(?countchildd14aAdAbDbAbA)
>
> Martynas