User:CarlJohanSveningsson

From Wikidata
Jump to navigation Jump to search

See my profile on meta

Open projects

[edit]

Family of Anderz Harning

[edit]

I opened a can of worms when I noticed the family of Anderz Harning (Q5790831) was described in his wikipedia page, but not in Wikidata. Thus for now I have created Q78456063, Q78455865 and Q78455285, and hope to return to tidy them up properly according to Wikidata:WikiProject Genealogy and the best of my ability.

Semantic web

[edit]

I do various experiments in getting acquainted with Wikidata, Binder, QuickStatements etc. Here's an example of what seems like the better template to use in wiki:

SELECT ?person ?personLabel ?personDescription (MIN(?relation) as ?_relation) ?place ?placeLabel ?placeLoc WHERE {
  
  # wd:Q509609 - Gnosjö kommun
  # wd:Q516336 - Södertälje kommun
  
  ?place wdt:P131/^wdt:P47 wd:Q509609 ;
         wdt:P625 ?placeLoc ;
         wdt:P31 wd:Q12813115 .
    
  ?person ?relation ?place ;
          wdt:P31 wd:Q5 .
  
  OPTIONAL { ?person wdt:P106 ?occupation }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
} GROUP BY ?person ?personLabel ?personDescription ?place ?placeLabel ?placeLoc 
  ORDER BY ?occupation ?placeLabel

Try it!

Wikidata as geography aid in genealogy

[edit]
#title:Socknar kring vald socken (de grannkommunerna ersatt)
#TEMPLATE={ "template": { "sv": "Välj en socken att utgå från ?valdSocken" }, "variables": { "?valdSocken": { "query": "SELECT DISTINCT ?id WHERE { ?id wdt:P31 wd:Q1523821. }" } } }
## defaultView:Map{"hide": "?sockenKoords"}
SELECT DISTINCT
?socken ?sockenLabel
?församling ?församlingLabel
  ?REGINA
  ?NAD ?NAD_Husförhörslängder ?NAD_Församlingsböcker ?NAD_Inflyttnings_och_Utflyttningslängder ?NAD_Födelse_och_dopböcker ?NAD_Lysnings_och_vigselböcker ?NAD_Död_och_begravningsböcker
?image
?kommun ?kommunLabel ?sockenKoords WHERE {
  BIND(wd:Q10551637 AS ?valdSocken)
  ?valdSocken wdt:P31 wd:Q1523821.
  {
    ?kommun (wdt:P1365*) ?valdSocken;
      wdt:P31 wd:Q127448.
  }
  UNION
  {
    ?valdKommun (wdt:P1365*) ?valdSocken;
      wdt:P31 wd:Q127448;
      wdt:P47 ?kommun.
  }
  ?socken wdt:P31 wd:Q1523821;
    (wdt:P1366*) _:b10.
  _:b10 wdt:P31 wd:Q11722303;
    wdt:P1366 ?kommun.
  ?församling (wdt:P1365*) ?socken;
    wdt:P31 wd:Q615980;
    wdt:P778 ?församlingsKod;                
    wdt:P5324 ?NADkod.
  OPTIONAL { ?socken wdt:P625 ?sockenKoords. }
  OPTIONAL { ?socken wdt:P18 ?image }
  OPTIONAL { ?församling wdt:P18 ?image }
  
  wd:P778 wdt:P1630 ?REGINA_formatter_without_a.
  BIND(CONCAT(?REGINA_formatter_without_a, '&a=0000') AS ?REGINA_formatter)
  BIND(IRI(REPLACE(?REGINA_formatter, "\\$1", ?församlingsKod)) AS ?REGINA)
  
  wd:P5324 wdt:P1630 ?NAD_formatter.
  BIND(IRI(REPLACE(?NAD_formatter, "\\$1", ?NADkod)) AS ?NAD)
  BIND(IRI(CONCAT(STR(?NAD), '/A I')) AS ?NAD_Husförhörslängder)
  BIND(IRI(CONCAT(STR(?NAD), '/A II a')) AS ?NAD_Församlingsböcker)
  BIND(IRI(CONCAT(STR(?NAD), '/B')) AS ?NAD_Inflyttnings_och_Utflyttningslängder)
  BIND(IRI(CONCAT(STR(?NAD), '/C')) AS ?NAD_Födelse_och_dopböcker)
  BIND(IRI(CONCAT(STR(?NAD), '/E I')) AS ?NAD_Lysnings_och_vigselböcker)
  BIND(IRI(CONCAT(STR(?NAD), '/F')) AS ?NAD_Död_och_begravningsböcker)
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv". }
}

Try it!

Alternative Wikidata tools

[edit]

I am an avid Jupyter user, as well as Gephi - so I have experimented some with Pywikibot (MediaWiki API) and other platforms