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

Generation of quickstatements #158

Open
fnielsen opened this issue Feb 22, 2023 · 1 comment
Open

Generation of quickstatements #158

fnielsen opened this issue Feb 22, 2023 · 1 comment

Comments

@fnielsen
Copy link
Owner

Example: add suffix-derived word instances to Danish nouns

SELECT (GROUP_CONCAT(?line; separator="\n") AS ?qs) {
  ?lexeme dct:language wd:Q9035 ;
          wikibase:lexicalCategory wd:Q1084 ;
          wdt:P5238 wd:L41160 ;
          wikibase:lemma ?lemma .
  OPTIONAL { ?lexeme wdt:P5238 ?verb_lexeme .
             ?verb_lexeme wikibase:lexicalCategory wd:Q24905 ; 
                          wikibase:lemma ?verb_lemma . }
  MINUS { ?lexeme wdt:P31 wd:Q112263731 }
  BIND(CONCAT(SUBSTR(STR(?lexeme), 32), ",Q112263731") AS ?line)
  BIND(1 as ?dummy)
}
GROUP BY ?dummy
@fnielsen
Copy link
Owner Author

This is better, see also WDscholia/scholia#2152

SELECT 
  ?qs # ?verb_lemma
WHERE {
  { BIND("qid,P31" AS ?qs) }
  UNION
  {
    ?lexeme dct:language wd:Q9035 ;
            wikibase:lexicalCategory wd:Q1084 ;
            wdt:P5238 wd:L36823 ;
            wikibase:lemma ?lemma .
    OPTIONAL { ?lexeme wdt:P5238 ?verb_lexeme .
               ?verb_lexeme wikibase:lexicalCategory wd:Q24905 ; 
                            wikibase:lemma ?verb_lemma . }
    MINUS { ?lexeme wdt:P31 wd:Q112263731 }
    BIND(CONCAT(SUBSTR(STR(?lexeme), 32), ",Q112263731") AS ?qs)
  }
}

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