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

Filter out things that only connect to a small number of items of a specific type #1

Open
stuppie opened this issue Jun 7, 2017 · 0 comments

Comments

@stuppie
Copy link
Collaborator

stuppie commented Jun 7, 2017

Example: Chancel -> material used -> pharmaceutical drug.
because there are some chancels that use iron, which is a pharmaceutical drug. Could filter these out by requiring both the subject and object to hit more than X different unique items.

select ?type ?typeLabel ?itemLabel (COUNT(*) AS ?count) where {
      ?item wdt:P31 wd:Q12140 .
      ?other_item wdt:P2176 ?item .
      ?other_item wdt:P31 ?type .
      OPTIONAL { ?type rdfs:label ?typeLabel. FILTER(LANG(?typeLabel) = "en"). }
      OPTIONAL { ?item rdfs:label ?itemLabel. FILTER(LANG(?itemLabel) = "en"). }
    } group by ?type ?typeLabel ?item ?itemLabel
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