Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SPARQL for compounds is slow #184

Open
fnielsen opened this issue Nov 23, 2023 · 0 comments
Open

The SPARQL for compounds is slow #184

fnielsen opened this issue Nov 23, 2023 · 0 comments

Comments

@fnielsen
Copy link
Owner

Instead of the below version one can add a WITH block

SELECT
  ?lexeme ?lexemeLabel
  ?lexical_category ?lexical_categoryLabel
  ?other_compounds
WHERE {
  {
    SELECT
      ?lexeme
      (GROUP_CONCAT(?compoundLabel; separator=" // ") AS ?other_compounds)
    WHERE {
      ?lexeme wdt:P5238 wd:L1010956 .
      OPTIONAL {
        ?lexeme wdt:P5238 ?compound .
        ?compound wikibase:lemma ?compoundLabel .
        FILTER (?compound != wd:L1010956)
      }
    }
    GROUP BY ?lexeme
  }    
  ?lexeme wikibase:lemma ?lexemeLabel .
  OPTIONAL {
    ?lexeme wikibase:lexicalCategory ?lexical_category .
    ?lexical_category rdfs:label ?lexical_categoryLabel .
    FILTER (LANG(?lexical_categoryLabel) = 'en')
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant