query-646929226c9b83f92a2038d5d44c78c2

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)maintained by WikiProject (P6104)equivalent property (P1628)subproperty of (P1647)inverse property (P1696)property constraint (P2302)class (P2308)relation (P2309)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
CONSTRUCT {
  ?prop rdf:type owl:ObjectProperty;
         rdfs:label ?propLabel;
        #  rdfs:domain ?domain;
        #  rdfs:range ?range;
         schema:description ?propDescription;
         skos:altLabel ?propAlias;
         owl:equivalentProperty ?equivalentProp;
         rdfs:subPropertyOf ?superProp;
         owl:inverseOf ?inverseProp.
  # ?domain rdf:type owl:Class;
  #         rdfs:label ?domainLabel;
  #         owl:unionOf ( ?domainElement) .
  # ?range rdf:type owl:Class;
  #        rdfs:label ?rangeLabel;
  #        owl:unionOf ( ?rangeElement ).
} WHERE {
  {
    ?prop wdt:P31/wdt:P279* wd:Q27525351.
  } UNION {
    ?prop wdt:P6104 wd:Q5830855.
  }

  VALUES ?type { # https://www.wikidata.org/wiki/Help:Data_type#Technical_details
    wikibase:WikibaseItem wikibase:ExternalId
  }
  ?prop wikibase:propertyType ?type;
        rdfs:label ?propLabel FILTER(lang(?propLabel) = 'en').

  # BIND(IRI(REPLACE(
  #     STR(?prop),
  #     'http://www.wikidata.org/entity/',
  #     'https://raw.githubusercontent.com/Danysan1/unibo-ke-matching-ontologies/main/wikidata/ontology/domain/'
  #   )) AS ?domain).
  # BIND(REPLACE(STR(?prop),'http://www.wikidata.org/entity/','domain of ') AS ?domainLabel).
  # OPTIONAL {
  #   ?prop p:P2302 [
  #     ps:P2302 wd:Q21503250;
  #     pq:P2308 ?domainElement;
  #     pq:P2309 wd:Q21503252
  #   ].
  # }

  # BIND(IRI(REPLACE(
  #     STR(?prop),
  #     'http://www.wikidata.org/entity/',
  #     'https://raw.githubusercontent.com/Danysan1/unibo-ke-matching-ontologies/main/wikidata/ontology/range/'
  #   )) AS ?range).
  # BIND(REPLACE(STR(?prop),'http://www.wikidata.org/entity/','range of ') AS ?rangeLabel).
  # OPTIONAL {
  #   ?prop p:P2302 [
  #     ps:P2302 wd:Q21510865;
  #     pq:P2308 ?rangeElement;
  #     pq:P2309 wd:Q21503252
  #   ].
  # }

  OPTIONAL { ?prop schema:description ?propDescription FILTER(lang(?propDescription) = 'en'). }
  OPTIONAL { ?prop skos:altLabel ?propAlias FILTER(lang(?propAlias) = 'en'). }
  OPTIONAL { ?prop wdt:P1628 ?equivalentProp. }
  OPTIONAL { ?prop wdt:P1647 ?superProp. }
  OPTIONAL { ?prop wdt:P1696 ?inverseProp. }
}
ORDER BY ?prop

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v13("?_const_15732a70_uri"):::projected v16("?_const_2697639b_uri") v15("?_const_2a9456f4_uri") v12("?_const_5fa4fb96_uri"):::projected v14("?_const_65cb026b_uri") v11("?_const_9285ccfc_uri"):::projected v10("?_const_ecbce060_uri") v9("?_const_f5e5585a_uri") v6("?equivalentProp"):::projected v8("?inverseProp"):::projected v1("?prop"):::projected v2("?propAlias"):::projected v4("?propDescription"):::projected v3("?propLabel"):::projected v7("?superProp"):::projected v5("?type"):::projected a1((" ")):::projected c6(["wd:Q5830855"]):::iri c4(["wd:Q27525351"]):::iri f0[["?propLabel = 'en'"]] f0 --> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P6104"--> c6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c4 end union0r <== or ==> union0l end bind1[/VALUES ?type/] bind1-->v5 bind10(["wikibase:WikibaseItem"]) bind10 --> bind1 bind11(["wikibase:ExternalId"]) bind11 --> bind1 v1 --"wikibase:propertyType"--> v5 v1 --"rdfs:label"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."schema:description".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."skos:altLabel".-> v2 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P1628".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P1647".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P1696".-> v8 end bind2[/""a""/] bind2 --as--o v9 bind3[/"'owl:ObjectProperty'"/] bind3 --as--o v10 bind4[/"'rdfs:label'"/] bind4 --as--o v11 bind5[/"'schema:description'"/] bind5 --as--o v12 bind6[/"'skos:altLabel'"/] bind6 --as--o v13 bind7[/"'owl:equivalentProperty'"/] bind7 --as--o v14 bind8[/"'rdfs:subPropertyOf'"/] bind8 --as--o v15 bind9[/"'owl:inverseOf'"/] bind9 --as--o v16