-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimma-artwork.sparql
132 lines (130 loc) · 3.76 KB
/
imma-artwork.sparql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
prefix fx: <http://sparql.xyz/facade-x/ns/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix xhtml: <http://www.w3.org/1999/xhtml#>
prefix dom: <https://html.spec.whatwg.org/#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX spice: <https://w3id.org/spice/imma/>
PREFIX arco: <https://w3id.org/arco/ontology/arco/>
PREFIX arco-cd: <https://w3id.org/arco/ontology/context-description/>
PREFIX arco-core: <https://w3id.org/arco/ontology/core/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX schema: <http://schema.org/>
CONSTRUCT {
?artefactEntity a schema:CreativeWork ;
dc:source ?artworkSourceUrl ;
arco-cd:hasInventory ?artworkCatalogueID ;
dc:description ?artworkDescription ;
schema:creditText ?artworkCreditLine ;
schema:size ?artworkDimensions ;
schema:maintainer <https://w3id.org/spice/institute/imma> ;
schema:material ?artworkMedium ;
schema:version ?artworkEdition ;
schema:image ?artefactDocumentation
.
?artefactDocumentation a schema:ImageObject ;
schema:caption ?caption ;
schema:copyrightNotice ?copyright ;
schema:url ?imageUrl ;
schema:maintainer <https://w3id.org/spice/institute/imma>
.
} WHERE {
#VALUES ( ?_artworkUrl ?_artworkNickname ) { ( "https://imma.ie/collection/beauty-parlor/" "beauty-parlor") } .
#
#BIND( REPLACE(REPLACE( ?_artworkUrl, "https://imma.ie/collection/", "" ), "/", "") AS ?artworkNickname ) .
#
BIND ( IRI( CONCAT("x-sparql-anything:media-type=text/html,location=", ?_artworkUrl) ) AS ?artworkFx ) .
BIND ( ?_artworkUrl AS ?artworkSourceUrl ) .
BIND ( IRI( CONCAT("https://w3id.org/spice/imma/artefact/", ?_artworkNickname) ) AS ?artefactEntity ) .
BIND ( IRI( CONCAT("https://w3id.org/spice/imma/documentation/", ?_artworkNickname ) ) AS ?artefactDocumentation ) .
#
# BIND ( IRI( CONCAT("https://w3id.org/spice/imma/documentation/", ?artworkNickname) ) AS ?artefactDocumentation ) .
#
SERVICE ?artworkFx {
{
[] xhtml:itemtype "http://schema.org/ImageObject" ;
?li0987 [ rdf:type xhtml:a ; xhtml:href ?imageUrl ]
.
} UNION {
[] xhtml:id "artwork-content" ;
rdf:_1 [
rdf:type xhtml:p ;
rdf:_1 ?artworkDescription
]
.
} UNION {
[] rdf:type xhtml:tr ;
rdf:_1 [
rdf:type xhtml:td ;
rdf:_1 "Medium" ;
] ;
rdf:_2 [
rdf:type xhtml:td ;
rdf:_1 ?artworkMedium ;
]
.
} UNION {
[] rdf:type xhtml:tr ;
rdf:_1 [
rdf:type xhtml:td ;
rdf:_1 "Dimensions" ;
] ;
rdf:_2 [
rdf:type xhtml:td ;
rdf:_1 ?artworkDimensions ;
]
.
} UNION {
[] rdf:type xhtml:tr ;
rdf:_1 [
rdf:type xhtml:td ;
rdf:_1 "Credit Line" ;
] ;
rdf:_2 [
rdf:type xhtml:td ;
rdf:_1 ?artworkCreditLine ;
]
.
} UNION {
[] rdf:type xhtml:tr ;
rdf:_1 [
rdf:type xhtml:td ;
rdf:_1 "Edition" ;
] ;
rdf:_2 [
rdf:type xhtml:td ;
rdf:_1 ?artworkEdition ;
]
.
} UNION {
[] rdf:type xhtml:tr ;
rdf:_1 [
rdf:type xhtml:td ;
rdf:_1 "Item Number" ;
] ;
rdf:_2 [
rdf:type xhtml:td ;
rdf:_1 ?artworkCatalogueID ;
]
.
} UNION {
[] xhtml:class "tags" ;
rdf:_1 [
rdf:type xhtml:li ;
rdf:_1 [
?iii ?tag ] ;
]
.
} UNION {
[ xhtml:class "annotation expander" ;
rdf:_1/xhtml:class "title" ;
rdf:_2/rdf:_1/rdf:_1 ?captionAuthor ;
rdf:_2/rdf:_3/rdf:_1 ?captionArt ;
rdf:_2/rdf:_4 ?captionRest ;
rdf:_2/rdf:_5 [a xhtml:p ; dom:innerText ?copyrightPart ]]
}
} .
BIND ( CONCAT (?captionAuthor, ", ", ?captionArt, ?captionRest) AS ?caption ) .
BIND ( REPLACE (?copyrightPart, ":?\\s*\\[email protected\\]\\s*", "") AS ?copyright ) .
}