This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Riksarkivet tumbnails | |
// @namespace https://sok.riksarkivet.se/ | |
// @description | |
// @version 1.0 | |
// @author Albin Larsson | |
// @match https://sok.riksarkivet.se/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import datetime | |
import requests | |
import pywikibot | |
site = pywikibot.Site('wikidata', 'wikidata') | |
repo = site.data_repository() | |
endpoint='https://api.smk.dk/api/v1/iiif/manifest/?id=' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX edm: <http://www.europeana.eu/schemas/edm/> | |
PREFIX dc: <http://purl.org/dc/elements/1.1/> | |
SELECT ?ku ('sameAs' AS ?relation) ?uri WHERE { | |
?item dc:identifier ?ku . | |
filter contains(?ku, 'kulturarvsdata.se') . | |
BIND(REPLACE(STR(?item), "proxy/provider", "item") AS ?uri) | |
} | |
LIMIT 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from ksamsok import KSamsok | |
from sochugc import UGC | |
api_key = input('Please enter your API key: ') | |
file_name = input('The name of input CSV: ') | |
username = input('Which username would you like to use: ') | |
soch = KSamsok() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import datetime | |
import requests | |
import pywikibot | |
site = pywikibot.Site('wikidata', 'wikidata') | |
repo = site.data_repository() | |
endpoint='https://sync.nm.delorean.se/objects?id=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchJson = async (url) => await (await fetch(url, { headers: new Headers({ 'Accept': 'application/json' }) })).json(); | |
const sochQuery = async (query) => { | |
const json = await fetchJson(`http://www.kulturarvsdata.se/ksamsok/api?x-api=test&method=search&query=geoDataExists=n%20AND%20thumbnailExists=j%20AND%20itemType=foto&recordSchema=xml&fields=itemDescription,itemLabel,thumbnail,byline,copyright,mediaLicense&startRecord=10000`); | |
return json.result.records.record.map(r => r['field']); | |
} | |
console.log(sochQuery('')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rdf:RDF xmlns="http://kulturarvsdata.se/ksamsok#" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:time="http://www.w3.org/2006/time#"> | |
<!-- här kommer nu institutionens alla objekt (resp alla nyligen ändrade objekt) --> | |
<Entity rdf:about="http://kulturarvsdata.se/{{inst}}/wikimedia/page-id"> | |
<ksamsokVersion>1.1</ksamsokVersion> | |
<serviceName>wikimedia</serviceName> | |
<serviceOrganization>{{inst}}</serviceOrganization> | |
<buildDate>2018-09-10</buildDate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rdf:RDF xmlns="http://kulturarvsdata.se/ksamsok#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#""> | |
<Entity rdf:about="http://kulturarvsdata.se/LSH/objects/21029"> | |
<isVisualizedBy rdf:resource="https://commons.wikimedia.org/wiki/File:Fingerring_av_guld_med_smaragder_och_briljanter,_1800-tal_-_Hallwylska_museet_-_110182.tif" | |
</Entity> | |
</rdf:RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sign languages by count | |
SELECT (COUNT(?lang) as ?language) ?langLabel ?lang | |
WHERE { | |
?item wdt:P2919 ?file . | |
?item p:P2919 ?statement . | |
?statement pq:P407 ?lang . | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } | |
} | |
GROUP BY ?langLabel ?lang | |
ORDER BY DESC(?language) |
NewerOlder