Project:SPARQL/admin: Difference between revisions

From Beyond Notability
Line 779: Line 779:
</sparql>
</sparql>


==== More potential problems with dates ====
=== More potential problems with dates ===


<sparql tryit="1">
<sparql tryit="1">
Line 830: Line 830:
</sparql>
</sparql>


=== Degrees lacking conferred by information ===
<sparql tryit="1">
#title:academic degree Oxford/Cambridge potential issues (again!)
#found at least one that was not picked up by previous queries because it lacked conferred by
#so this is simply a list of all academic degree with no conferred by.
#many will simply lack enough information (including date) to make any decision.
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/>
SELECT distinct ?personLabel ?degreeLabel  ?date  ?link
WHERE { 
  ?person bnwdt:P3 bnwd:Q3 . #select women
 
  # academic degree = P59.
  ?person bnp:P59 ?s . 
    ?s bnps:P59 ?degree . # type of degree
 
  # optional qualifiers for degree
 
  # P60 subject
  # optional { ?s bnpq:P60 ?subject}
 
  # P61 conferred by
  optional {  ?s bnpq:P61 ?by .  }
 
  #filter not exists { ?s bnpq:P61 ?by .  }
  filter(!bound(?by)) . # filter not exists doesn't work for this; idk why.
 
  # date
  optional { ?s (bnpq:P1 | bnpq:P27 | bnpq:P28 ) ?date . }
  #filter not exists { ?s (bnpq:P1 | bnpq:P27 | bnpq:P28 ) ?date .}
 
 
  # direct link to relevant statement
  BIND (REPLACE(STR(?s), "^.*/([^/]*)$", "$1") as ?sid).
    # for some grrr reason the first dash is replaced with a $ in the html id.
  bind(replace(?sid, "^(Q\\d+)-", "$1\\$") as ?pid) .
  bind(iri(concat(str(?person), "#", ?pid)) as ?link )
       
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en".}
}
order by ?personLabel ?degreeLabel
</sparql>


== Item / free text ==
== Item / free text ==