fredag 12 augusti 2016

Who is famous in FindAGrave

See discussion

Map with just FindAGrave and buried location


Dates from SPARQL

Task how to get date ranges, or century, year and month precision in date.

Example Q337189 WikiTree Arnulfing-2

# Get date forms for Q337189 
PREFIX entity: <http://www.wikidata.org/entity/>
SELECT ?label ?birthDate ?birthYear ?birthMonth ?birthDay ?WikiTreeID WHERE {
hint:Query hint:optimizer 'None' .
  entity:Q337189 rdfs:label ?label filter (lang(?label) = "en")
  entity:Q337189 wdt:P2949 ?WikiTreeID .
  entity:Q337189 wdt:P570 ?birthDate .

  BIND (year(?birthDate) as ?birthYear)
  BIND (month(?birthDate) as ?birthMonth)
  BIND (day(?birthDate) as ?birthDay)
}   


Problem 
  1. Q318912 has 995 in
    1. https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q318912 ==>

      "mainsnak": {
                                  "snaktype": "value",
                                  "property": "P570",
                                  "datavalue": {
                                      "value": {
                                          "time": "+0995-01-01T00:00:00Z",
                                          "timezone": 0,
                                          "before": 0,
                                          "after": 0,
                                          "precision": 9,
                                          "calendarmodel": "http://www.wikidata.org/entity/Q1985786"
                                      },
                                      "type": "time"
                                  },
                                  "datatype": "time"
                              },
      1. "precision": 9 ==>
  2. Q692927 Property:P570
    1. https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q692927

      1. 
        "P570": [
                            {
                                "mainsnak": {
                                    "snaktype": "value",
                                    "property": "P570",
                                    "datavalue": {
                                        "value": {
                                            "time": "+1699-01-01T00:00:00Z",
                                            "timezone": 0,
                                            "before": 0,
                                            "after": 0,
                                            "precision": 9,
                                            "calendarmodel": "http://www.wikidata.org/entity/Q1985727"
                                        },
                                        "type": "time"
                                    },
                                    "datatype": "time"
                                },
      2. ===> precision 9 ==> year

  3. Check 

Calendar

torsdag 11 augusti 2016

onsdag 10 augusti 2016

SPARQL link to Wikipedia article in Swedish

   
    OPTIONAL {
      ?article schema:about ?person .
      ?article schema:inLanguage "sv" .
      ?article schema:isPartOf <https://sv.wikipedia.org/> .
    }

Map query churchyard https://goo.gl/oKfh4p

tisdag 9 augusti 2016

Swedish writers

Query https://goo.gl/JGP2qD

With profile on WikiTree

Properties also on profiles with the WikiTreeID

#What other properties does a item with the WikiData property have
SELECT ?prop ?propLabel ?count WHERE {
    {
        SELECT ?prop (COUNT(DISTINCT ?item) AS ?count) WHERE {
         
           hint:Query hint:optimizer "None" .
           ?item wdt:P2949 ?yp_id .
           ?item ?p ?id .
           ?prop wikibase:directClaim ?p .
           {?prop wdt:P31 wd:Q19847637}  # Wikidata property representing a unique identifier
             UNION
           {?prop wdt:P31 wd:Q19595382}  # Wikidata property for authority control for people
         
       
        }  GROUP BY ?prop
    }
         
    SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en" .
    }

} ORDER BY DESC (?count)

Result 2016-aug-9

prop   propLabel                count
P2949  WikiTree ID              3669
P646   Freebase ID              2676   --- Google project that now is part of WIkiData
P227   GND ID                   2100   --- German National Library authority database
P2163  FAST-ID                  1733   --- WorldCat projectr learn more
P1006  National Thesaurus for Author Names ID 1260 --- The Dutch National Thesaurus
P648   Open Library ID          756   --- Open Library a Library for all books published
P1263  NNDB people ID           728   -- Notable database 
P1871  CERL ID                  718   -- Notable database
P1315  People Australia ID      661
P349   NDL ID                   645
P1415  Oxford Biography Index Number 632
P345   IMDb ID                  617
P1816  National Portrait Gallery (London) person ID     605
P1819  Genealogics.org person ID 575
P409   NLA (Australia) ID       566
P535   Find a Grave grave ID    559
P691   NKCR AUT ID              539
P906   SELIBR                   514
P1273  CANTIC-ID                472
P245   ULAN ID                  423

torsdag 4 augusti 2016

People buried on cemetery Norra Begravningsplatsen, Stockholm, Sweden Q252312 and if they have a picture of the grave or not

Document location of all graves and grave pictures on WikiData

Project: Document all people in WikiData buried on Norra Begravningsplatsen and generate a map with exact location of the graves ==> easier to find the graves. Add those people also to FindAGrave and take pictures of grave stones

Norra Begravningsplatsen is a cemetery in Stockholm, Sweden with about 30000 people many famous.....

Wikidata and graves

In WikiData you can also add qualifiers like



Query is ?person wdt:P119 wd:Q252312 #Place of burial

  1. All graves with graveplot and coordinates
  2. All graves with FindAGraveID
  3. All graves with WikiTreeID

Good links

Example queries

# Query Find in WikiData people with Place of Burial Q252312 Norra Begravningsplatsen
# Show Wikitree ID, Find A Grave ID and if picture of the grave exist
select  ?person ?personLabel  ?personDescription   ?pic ?picGrave ?WikiTree ?FindAGrave{
{
  ?person wdt:P119 wd:Q252312 #Place of burial
   OPTIONAL { ?person wdt:P2949 ?WikiTreeID .} # If we have a WikiTree profile
   OPTIONAL { ?person wdt:P535 ?FindAGraveID .} # If we have a FindAGrave ID
   OPTIONAL{ ?person wdt:P18 ?pic .} # If we have an illustration
   OPTIONAL{ ?person wdt:P1442 ?picGrave .} # If we have a picture of the grave
   BIND (URI(CONCAT("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&df=all&GRid=",?FindAGraveID)) AS ?FindAGrave)

 }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en","sv"}
 }
Order by ?personLabel


Images of graves  P1442 today of people buried on Q252312
Map of graves with coordinates - english
Map - Swedish labels 

# Query Find in WikiData people with Place of Burial Q252312 Norra Begravningsplatsen
# Show Wikitree ID, Find A Grave ID and if picture of the grave exist
#defaultView:Map
select  ?person ?personLabel  ?personDescription  ?graveplot ?coord ?pic ?picGrave ?WikiTree ?FindAGrave{
{
?person wdt:P119 wd:Q252312; #Place of burial
            p:P119 [
              pq:P965 ?graveplot;
              pq:P625 ?coord].                        
   OPTIONAL { ?person wdt:P2949 ?WikiTreeID .} # If we have a WikiTree profile
   OPTIONAL { ?person wdt:P535 ?FindAGraveID .} # If we have a FindAGrave ID
   OPTIONAL{ ?person wdt:P18 ?pic .} # If we have an illustration
   OPTIONAL{ ?person wdt:P1442 ?picGrave .} # If we have a picture of the grave
   BIND (URI(CONCAT("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&df=all&GRid=",?FindAGraveID)) AS ?FindAGrave)
   BIND (URI(CONCAT("http://www.wikitree.com/wiki",?WikiTreeID)) AS ?WikiTree)

 }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en","sv"}
 }
Order by ?personLabel

tisdag 2 augusti 2016

UK Primeministers


UK Prime ministers ordered and with WikiTree and if they have a Find A Grave profile link image 

måndag 1 augusti 2016

Wikidata tools/hacks


Ancient intellectual network



Graph generated with dataviz

of http://projetjourdain.org/network/index.html





Animated GIF GIF showing the additions of the coordinate location property to Wikidata items over roughly the first 40 days of enabling the coordinates data type.