Skip to content

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

@stuppie

Description

@stuppie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions