Skip to content

rdf 1.2 (rdf-star) meta queries very slow #1687

Description

@majidaldo

I have a db with 'meta'/nested triples. As soon as I wrap a triple with << >>, the query becomes orders of magnitude slower whereas the corresponding 'normal' query is relatively instant.

Activity

  1. Tpt commented on Apr 24, 2026

    @Tpt
    Collaborator

    Currently Oxigraph does not contain any good indexes for triple terms. So, queries like:

    SELECT ?s ?p ?o WHERE {
       << ?s ex:p ex:o >> ?p ?o . 
    }

    is executed just like:

    SELECT ?s ?p ?o WHERE {
       << ?s ?tp ?to >> ?p ?o . 
       FILTER(?tp = ex:p && ?to = ex:o)
    }

    We can optimize it by building indexes of triple terms like https://rubensworks.github.io/article-quoted-triples-index/

  2. majidaldo commented on Apr 24, 2026

    @majidaldo
    Author

    Currently Oxigraph does not contain any good indexes for triple terms. So, queries like:

    SELECT ?s ?p ?o WHERE {
    << ?s ex:p ex:o >> ?p ?o .
    }
    is executed just like:

    SELECT ?s ?p ?o WHERE {
    << ?s ?tp ?to >> ?p ?o .
    FILTER(?tp = ex:p && ?to = ex:o)
    }
    We can optimize it by building indexes of triple terms like https://rubensworks.github.io/article-quoted-triples-index/

    What about querying the corresponding mapping quoted triples -> triples.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions