User:Fnielsen

From Wikidata
Jump to: navigation, search
Babel user information
da-N Denne bruger har dansk som modersmål.
en-3 This user has advanced knowledge of English.
sv-1 Den här användaren har grundläggande kunskaper i svenska.
nn-1 Denne brukaren meistrar nynorsk på eit grunnleggjande nivå.
nb-1 Denne brukeren har grunnleggende kjennskap til norsk (bokmål).
de-1 Dieser Benutzer beherrscht Deutsch auf grundlegendem Niveau.
fr-1 Cet utilisateur dispose de connaissances de base en français.
is-0 Þessi notandi talar ekki íslensku (á erfitt með að skilja hana eða kýs að tala hana ekki).
fo-0 Hesin brúkarin hevur onga vitan um føroyskt (ella skilur tað eitt sindur við stórum trupulleikum).
kl-0 Una atuisoq kalaallisut paasisinnaanngilaq.
nl-0 Deze gebruiker heeft geen kennis van het Nederlands (of begrijpt het met grote moeite).
eo-0 Ĉi tiu uzanto ne komprenas Esperanton, aŭ tre malfacile komprenas.
Users by language

Finn Årup Nielsen, Denmark


Quote[edit]

"Until Wikidata can give me a list of all movies shot in the 60s in Spain, in which a black female horse is stolen by a left-handed actor playing a Portuguese orphan, directed by a colorblind German who liked sailing, and written by a dog-owning women from Helsinki, we have more work to do." — Tobias1984 18:39, 7 December 2013 (UTC)

See also User:John Vandenberg.

Tools[edit]

Wikidata query[edit]

Artworks of Martinus Rørby on SMK[edit]

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>

SELECT ?artwork ?artworkLabel ?kms ?height ?width ?url WHERE {	
   ?artwork wdt:P195 wd:Q671384 .  # SMK
   ?artwork wdt:P170 wd:Q979541 .  # Martinus Rørby
   SERVICE wikibase:label {
     bd:serviceParam wikibase:language "da" .
   } 
   OPTIONAL {?artwork wdt:P217 ?kms } 
   OPTIONAL {?artwork wdt:P2048 ?height } 
   OPTIONAL {?artwork wdt:P2049 ?width } 
   OPTIONAL {?artwork wdt:P973 ?url } 
 } LIMIT 20

Artworks of dogs at SMK[edit]

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>

SELECT ?artwork ?artworkLabel ?url WHERE {	
   ?artwork wdt:P195 wd:Q671384 .         # SMK
   ?artwork wdt:P180/wdt:P279* wd:Q144 .  # Dog
   SERVICE wikibase:label {
     bd:serviceParam wikibase:language "da" .
   } 
   OPTIONAL {?artwork wdt:P973 ?url } 
 }

SMK artworks and "motiv" (depicts) in Python[edit]

Inspired from https://www.pfenninger.org/posts/mapping-the-worlds-nuclear-power-plants/

import numpy as np
import pandas as pd
import sparql

service = sparql.Service("https://query.wikidata.org/sparql", method="GET")
statement = """
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>

SELECT ?artwork ?artworkLabel ?motiv ?motivLabel WHERE {	
   ?artwork wdt:P195 wd:Q671384 .        
   ?artwork wdt:P180 ?motiv . 
   SERVICE wikibase:label {
     bd:serviceParam wikibase:language "da,en" .
   } 
 } 
"""

result = service.query(statement)
df = pd.DataFrame(result.fetchall(), columns=result.variables)

# Set up feature matrix
motivs = set([item.value for item in df['motivLabel']])
artworks = set([item.value for item in df['artwork']])
feature_matrix = pd.DataFrame(0, index=artworks, columns=motivs)
artwork_mapper = {}
for n, row in df.iterrows():
    artwork = row['artwork'].value
    motiv = row['motivLabel'].value
    feature_matrix.ix[artwork, motiv] = 1 
    artwork_mapper[artwork] = row['artworkLabel'].value

# Possible scaling
feature_matrix = feature_matrix.divide(np.sqrt(feature_matrix.sum(axis=1)), axis='index')

# Machine learning decomposition
from sklearn.decomposition import NMF
decomposer = NMF(n_components=2)
decomposer.fit(feature_matrix)
transformed = decomposer.transform(feature_matrix)

Result:

>>> feature_matrix.columns[(-decomposer.components_[0, :]).argsort()[:10]]
Index([u'hund', u'mand', u'kvinde', u'træ', u'bord', u'kurv', u'borddug', u'barn', u'hest', u'Sværd, sværd'], dtype='object')
>>> feature_matrix.columns[(-decomposer.components_[1, :]).argsort()[:10]]
Index([u'himmel', u'sky', u'mand', u'vej', u'Hede, hede', u'Lyng, lyng', u'træ', u'Bjerg, bjerg', u'Vandfald, vandfald', u'Får, får'], dtype='object')

>>> [artwork_mapper[q] for q in feature_matrix.index[(-transformed[:, 0]).argsort()[:10]]]
[u'Dansebakken ved Sorgenfri', u'Johannes D\xf8berens henrettelse', u'B\xf8geskov i maj. Motiv fra Iselingen', u'Frederik II bygger Kronborg', u'Frederik II bygger Kronborg', u'En hyrdinde med en hund', u'Fra et romersk osteria', u'Et selskab af danske kunstnere i Rom', u'Susanne og de to \xe6ldste', u'Bella and Hanna. The Eldest Daughters of M. L. Nathanson']
>>> [artwork_mapper[q] for q in feature_matrix.index[(-transformed[:, 1]).argsort()[:10]]]
[u'En jysk f\xe5rehyrde p\xe5 heden', u'Landskab med vandfald og hytte', u'Maleren i landsbyen', u'Udsigt gennem tre af de nordvestlige buer i Colosseums tredje stokv\xe6rk', u'Udsigt fra Kronborg Vold over flagbatteriet og Sundet til den svenske kyst', u'Bjerglandskab med en flod', u'Hedestudie', u'Landscape with Two Horses', u'Udsigt fra Parthenon p\xe5 Akropolis', u'Birketr\xe6er p\xe5 L\xe6s\xf8 efter regn']

Six degrees of Kevin Bacon[edit]

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?movie1Label ?actor1Label ?movie2Label ?actor2Label ?movie3Label ?actor3Label ?movie4Label WHERE {
   ?movie1 wdt:P161 wd:Q20980928 .  # Finn Årup Nielsen
   ?movie1 wdt:P161 ?actor1 .
   ?movie2 wdt:P161 ?actor1 .
   ?movie2 wdt:P161 ?actor2 . 
   ?movie3 wdt:P161 ?actor2 . 
   ?movie3 wdt:P161 ?actor3 .
   ?movie4 wdt:P161 ?actor3 .
   ?movie4 wdt:P161 wd:Q3454165 .   # Kevin Bacon
  
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,da" .
   }
 }

Notes[edit]

Special Qs:

Subpages[edit]

Vandalism examples in Wikidata[edit]

  • [6] French football player Anthony Martial called "rien".
  • [7] American basketball player Michael Jordan called an "insect".

Odd and wrong edits[edit]

Kilder[edit]

Kilder synes ikke at virker endnu. Der er lidt hjælp her: Help:Sources/da

Properties[edit]

Suggestions:

Bibliographic data[edit]

Examples:

Property[edit]

https://docs.google.com/spreadsheet/ccc?key=0AlPNcNlN2oqvdFQyR2F5YmhrMWpXaUFkWndQWUZyemc#gid=0

Wikidata source metadata[edit]

Authority control