-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5defc2f
commit 99f6061
Showing
3 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,6 @@ let $header := | |
"
" | ||
) | ||
|
||
let $message := 'periodicals here' | ||
|
||
|
||
return ( | ||
$header, | ||
( | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
xquery version "1.0"; | ||
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | ||
declare option exist:serialize "method=text media-type=text/turtle"; | ||
|
||
let $doc := doc('xmldb:exist:///db/apps/pessoa/data/indices.xml') | ||
let $ampersand := '&' (: ampersand :) | ||
let $tab := '	' (: tab :) | ||
let $header := concat( | ||
"@prefix ccehperson: <http://www.pessoadigital.pt/index/names#> .
", | ||
"@prefix ccehperiodical: <http://www.pessoadigital.pt/index/periodicals#> .
", | ||
"@prefix ccehpublications: <http://www.pessoadigital.pt/pub/> .
", | ||
"@prefix crm: <http://www.cidoc-crm.org/cidoc-crm/> .
", | ||
"@prefix dbo: <http://dbpedia.org/ontology/> .
", | ||
"@prefix foaf: <http://xmlns.com/foaf/0.1/> .
", | ||
"@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
", | ||
"@prefix wd: <http://www.wikidata.org/entity/> .
", | ||
"@prefix viaf: <http://viaf.org/viaf/> .
", | ||
"
" | ||
) | ||
|
||
return ( | ||
$header, | ||
(for $person in $doc//tei:person | ||
let $person_id := $person/@xml:id | ||
let $main_name := $person/tei:persName[@type='main']/data(.) | ||
let $gender := $person/tei:sex/data(.) | ||
let $labels := $person/tei:persName[not(@type='main')]/data(.) | ||
return ( | ||
concat('ccehperson:',$person_id, ' a crm:E21_Person ;', '
'), | ||
concat($tab,'rdfs:label "', $main_name,'" ;','
'), | ||
for $viaf_id in $person/tei:idno[@type='viaf'] | ||
return if ($viaf_id) then concat($tab,'= ', 'viaf:',$viaf_id, '>', ' ;','
') else (), | ||
for $gnd_id in $person/tei:idno[@type='gnd'] | ||
return if ($gnd_id) then concat($tab,'= ', '<','http://d-nb.info/gnd/',$gnd_id, '>', ' ;','
') else (), | ||
for $wikidata_id in $person/tei:idno[@type='wikidata'] | ||
return if ($wikidata_id) then concat($tab,'= ','wd:',$wikidata_id, '>', ' ;','
') else (), | ||
concat($tab, 'foaf:gender "', $gender, '" ;','
'), | ||
if (exists($labels)) then concat($tab, 'foaf:name ') else (), | ||
( | ||
for $label at $i in $labels | ||
return if ($label) then | ||
if ($i = count($labels)) | ||
then concat('"',$label,'";
') | ||
else concat('"',$label,'", ') | ||
else () | ||
), | ||
'
') | ||
), | ||
(for $periodical in $doc//tei:list[@type='periodical']/tei:item | ||
let $periodical_id := $periodical/@xml:id/data(.) | ||
let $periodical_name := $periodical/tei:title/data(.) | ||
return( | ||
concat('ccehperiodical:',$periodical_id, ' a dbo:Journal ;','
'), | ||
concat($tab,'rdfs:label "', $periodical_name,'" ;','
'), | ||
for $viaf_id in $periodical/tei:idno[@type='viaf'] | ||
return if ($viaf_id) then concat($tab,'= ', 'viaf:',$viaf_id, '>', ' ;','
') else (), | ||
for $gnd_id in $periodical/tei:idno[@type='gnd'] | ||
return if ($gnd_id) then concat($tab,'= ', '<','http://d-nb.info/gnd/',$gnd_id, '>', ' ;','
') else (), | ||
for $wikidata_id in $periodical/tei:idno[@type='wikidata'] | ||
return if ($wikidata_id) then concat($tab,'= ','wd:',$wikidata_id, '>', ' ;','
') else (), | ||
'
')), | ||
(for $publication in $doc//tei:list[@type='publications']/tei:item | ||
let $publication_id := $publication/@xml:id/data(.) | ||
let $publication_name := $publication/tei:title/data(.) | ||
return( | ||
concat('ccehpublication:',$publication_id, ' a dbo:LiteraryWork ;','
'), | ||
concat($tab,'rdfs:label "', $publication_name,'" ;','
'), | ||
for $viaf_id in $publication/tei:idno[@type='viaf'] | ||
return if ($viaf_id) then concat($tab,'= ', 'viaf:',$viaf_id, '>', ' ;','
') else (), | ||
for $gnd_id in $publication/tei:idno[@type='gnd'] | ||
return if ($gnd_id) then concat($tab,'= ', '<','http://d-nb.info/gnd/',$gnd_id, '>', ' ;','
') else (), | ||
for $wikidata_id in $publication/tei:idno[@type='wikidata'] | ||
return if ($wikidata_id) then concat($tab,'= ','wd:',$wikidata_id, '>', ' ;','
') else (), | ||
'
')) | ||
) | ||
|