This file contains hidden or 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
#!/bin/bash | |
# | |
# Stažení dumpů CEDRu | |
set -e | |
# URL SPARQL endpointu CEDRu | |
ENDPOINT="http://cedropendata.mfcr.cz/c3lod/cedr/sparql" | |
# SPARQL dotaz pro získání URL dumpů |
This file contains hidden or 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 : <http://example.com/> | |
DELETE { | |
?r ?outP ?outO . | |
?inS ?inP ?r . | |
} | |
INSERT { | |
?sampleR ?outP ?outO . | |
?inS ?inP ?sampleR . | |
} |
This file contains hidden or 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 : <http://example.com/> | |
DELETE { | |
?r1 ?outP ?outO . | |
?inS ?inP ?r1 . | |
} | |
INSERT { | |
?inS ?inP ?r2 . | |
} | |
WHERE { |
This file contains hidden or 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 : <http://example.com/> | |
DELETE { | |
?r ?outP ?outO . | |
?inS ?inP ?r . | |
} | |
WHERE { | |
{ | |
SELECT (SAMPLE(?r) AS ?sampleR) ?hash | |
WHERE { |
This file contains hidden or 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 : <http://example.com/> . | |
:r1 a :C ; | |
:name "a" . | |
:r2 a :C ; | |
:name "a" . | |
:r3 a :C ; | |
:name "a" ; |
This file contains hidden or 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
DELETE { | |
?bnode ?outP ?outO . | |
?inS ?inP ?bnode . | |
} | |
INSERT { | |
?iri ?outP ?outO . | |
?inS ?inP ?iri . | |
} | |
WHERE { | |
{ |
This file contains hidden or 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
# Fills empty cells with values of their nearest preceding non-empty cells. | |
# For performance reasons, the function is restricted to :column_1. | |
# Even so, it takes about 10 minutes for 10k row CSV. | |
PREFIX : <http://localhost/> | |
PREFIX csvw: <http://www.w3.org/ns/csvw#> | |
INSERT { | |
?row :column_1 ?column_1 . | |
} |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Compute the diff between SKOS code lists. | |
# Usage: ./code_list_diff.sh [-h|--help] old_version new_version | |
set -e | |
shopt -s extglob | |
V1=$1 | |
V2=$2 |
This file contains hidden or 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"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> | |
<xsl:output encoding="UTF-8" indent="yes" method="xml" /> | |
<xsl:template match="/*"> | |
<xsl:element name="{name()}"> | |
<xsl:call-template name="group"/> | |
</xsl:element> | |
</xsl:template> |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Match concepts from two SKOS code lists. | |
# Usage: match_code_lists.sh code_list_1.ttl code_list_2.ttl | |
# Outputs RDF in Turtle with the links found. | |
set -e | |
shopt -s extglob | |
die () { |