Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
ls.ext
Commits
aa507d68
Commit
aa507d68
authored
Nov 05, 2018
by
Petter Goksøyr Åsen
Browse files
cast explicitly true as xsd:boolean
parent
a4cc2d0b
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
redef/services/src/main/java/no/deichman/services/entity/repository/SPARQLQueryBuilder.java
View file @
aa507d68
...
@@ -678,6 +678,7 @@ public final class SPARQLQueryBuilder {
...
@@ -678,6 +678,7 @@ public final class SPARQLQueryBuilder {
+
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
+
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
+
"PREFIX deich: <%1$s>\n"
+
"PREFIX deich: <%1$s>\n"
+
"PREFIX role: <%2$s>\n"
+
"PREFIX role: <%2$s>\n"
+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n"
+
"SELECT DISTINCT ?relation ?targetUri ?mainTitle ?subtitle ?partTitle ?partNumber ?publicationYear ?type ?isMainEntry ?isRole\n"
+
"SELECT DISTINCT ?relation ?targetUri ?mainTitle ?subtitle ?partTitle ?partNumber ?publicationYear ?type ?isMainEntry ?isRole\n"
+
"WHERE {\n"
+
"WHERE {\n"
+
" {\n"
+
" {\n"
...
@@ -703,10 +704,10 @@ public final class SPARQLQueryBuilder {
...
@@ -703,10 +704,10 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?withContributor deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?withContributor deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL {"
+
" OPTIONAL {"
+
" ?contribution a deich:MainEntry . \n"
+
" ?contribution a deich:MainEntry . \n"
+
" BIND(
true as
?isMainEntry) . \n"
+
" BIND(
xsd:boolean(true) AS
?isMainEntry) . \n"
+
" } \n"
+
" } \n"
+
" BIND(?withContributor
as
?targetUri) . \n"
+
" BIND(?withContributor
AS
?targetUri) . \n"
+
" BIND(
true as
?isRole) . \n"
+
" BIND(
xsd:boolean(true) AS
?isRole) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?workRelation deich:work <%3$s> ;\n"
+
" ?workRelation deich:work <%3$s> ;\n"
+
" deich:hasRelationType ?relation .\n"
+
" deich:hasRelationType ?relation .\n"
...
@@ -727,8 +728,8 @@ public final class SPARQLQueryBuilder {
...
@@ -727,8 +728,8 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?pubInSeries deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?pubInSeries deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?pubInSeries deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?pubInSeries deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?pubInSeries deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?pubInSeries deich:publicationYear ?publicationYear } \n"
+
" BIND(iri(deich:inSerial)
as
?relation) .\n"
+
" BIND(iri(deich:inSerial)
AS
?relation) .\n"
+
" BIND(?pubInSeries
as
?targetUri) . \n"
+
" BIND(?pubInSeries
AS
?targetUri) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?workSeriesParticipation deich:workSeries <%3$s> .\n"
+
" ?workSeriesParticipation deich:workSeries <%3$s> .\n"
+
" ?workInSeries deich:isPartOfWorkSeries ?workSeriesParticipation ;\n"
+
" ?workInSeries deich:isPartOfWorkSeries ?workSeriesParticipation ;\n"
...
@@ -738,8 +739,8 @@ public final class SPARQLQueryBuilder {
...
@@ -738,8 +739,8 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?workInSeries deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workInSeries deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workInSeries deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workInSeries deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workInSeries deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?workInSeries deich:publicationYear ?publicationYear } \n"
+
" BIND(iri(deich:isPartOfWorkSeries)
as
?relation) .\n"
+
" BIND(iri(deich:isPartOfWorkSeries)
AS
?relation) .\n"
+
" BIND(?workInSeries
as
?targetUri) . \n"
+
" BIND(?workInSeries
AS
?targetUri) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?instrumentation deich:hasInstrument <%3$s> .\n"
+
" ?instrumentation deich:hasInstrument <%3$s> .\n"
+
" ?workWithInstruments deich:hasInstrumentation ?instrumentation ;\n"
+
" ?workWithInstruments deich:hasInstrumentation ?instrumentation ;\n"
...
@@ -757,8 +758,8 @@ public final class SPARQLQueryBuilder {
...
@@ -757,8 +758,8 @@ public final class SPARQLQueryBuilder {
+
" ?withPubPart deich:hasPublicationPart ?pubPart .\n"
+
" ?withPubPart deich:hasPublicationPart ?pubPart .\n"
+
" ?pubPart a ?type ;\n"
+
" ?pubPart a ?type ;\n"
+
" deich:mainTitle ?mainTitle . \n"
+
" deich:mainTitle ?mainTitle . \n"
+
" BIND(?withPubPart
as
?targetUri) . \n"
+
" BIND(?withPubPart
AS
?targetUri) . \n"
+
" BIND(
true as
?isRole) . \n"
+
" BIND(
xsd:boolean(true) AS
?isRole) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?pubPart deich:publicationOf <%3$s> .\n"
+
" ?pubPart deich:publicationOf <%3$s> .\n"
+
" ?withPubPart deich:hasPublicationPart ?pubPart ;\n"
+
" ?withPubPart deich:hasPublicationPart ?pubPart ;\n"
...
@@ -775,8 +776,8 @@ public final class SPARQLQueryBuilder {
...
@@ -775,8 +776,8 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?workWithSubj deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workWithSubj deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workWithSubj deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithSubj deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithSubj deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?workWithSubj deich:publicationYear ?publicationYear } \n"
+
" BIND(iri(deich:subject)
as
?relation) .\n"
+
" BIND(iri(deich:subject)
AS
?relation) .\n"
+
" BIND(?workWithSubj
as
?targetUri) . \n"
+
" BIND(?workWithSubj
AS
?targetUri) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?workWithCompType deich:hasCompositionType <%3$s> ;\n"
+
" ?workWithCompType deich:hasCompositionType <%3$s> ;\n"
+
" a ?type ;\n"
+
" a ?type ;\n"
...
@@ -786,7 +787,7 @@ public final class SPARQLQueryBuilder {
...
@@ -786,7 +787,7 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?workWithCompType deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithCompType deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithCompType deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?workWithCompType deich:publicationYear ?publicationYear } \n"
+
" BIND(iri(deich:hasCompositionType) as ?relation) .\n"
+
" BIND(iri(deich:hasCompositionType) as ?relation) .\n"
+
" BIND(?workWithCompType
as
?targetUri) . \n"
+
" BIND(?workWithCompType
AS
?targetUri) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?workWithGenre deich:genre <%3$s> ;\n"
+
" ?workWithGenre deich:genre <%3$s> ;\n"
+
" a ?type ;\n"
+
" a ?type ;\n"
...
@@ -795,8 +796,8 @@ public final class SPARQLQueryBuilder {
...
@@ -795,8 +796,8 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?workWithGenre deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workWithGenre deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?workWithGenre deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithGenre deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?workWithGenre deich:publicationYear ?publicationYear } \n"
+
" OPTIONAL { ?workWithGenre deich:publicationYear ?publicationYear } \n"
+
" BIND(iri(deich:genre)
as
?relation) .\n"
+
" BIND(iri(deich:genre)
AS
?relation) .\n"
+
" BIND(?workWithGenre
as
?targetUri) . \n"
+
" BIND(?workWithGenre
AS
?targetUri) . \n"
+
" } UNION {\n"
+
" } UNION {\n"
+
" ?publWithPlace deich:hasPlaceOfPublication <%3$s> ;\n"
+
" ?publWithPlace deich:hasPlaceOfPublication <%3$s> ;\n"
+
" a ?type ;\n"
+
" a ?type ;\n"
...
@@ -804,11 +805,11 @@ public final class SPARQLQueryBuilder {
...
@@ -804,11 +805,11 @@ public final class SPARQLQueryBuilder {
+
" OPTIONAL { ?publWithPlace deich:subtitle ?subtitle } \n"
+
" OPTIONAL { ?publWithPlace deich:subtitle ?subtitle } \n"
+
" OPTIONAL { ?publWithPlace deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?publWithPlace deich:partTitle ?partTitle } \n"
+
" OPTIONAL { ?publWithPlace deich:partNumber ?partNumber } \n"
+
" OPTIONAL { ?publWithPlace deich:partNumber ?partNumber } \n"
+
" BIND(iri(deich:hasPlaceOfPublication)
as
?relation) .\n"
+
" BIND(iri(deich:hasPlaceOfPublication)
AS
?relation) .\n"
+
" BIND(?publWithPlace
as
?targetUri) . \n"
+
" BIND(?publWithPlace
AS
?targetUri) . \n"
+
" }\n"
+
" }\n"
+
" FILTER(STRSTARTS(STR(?type), \"http://data.deichman.no/ontology#\"))"
+
" FILTER(STRSTARTS(STR(?type), \"http://data.deichman.no/ontology#\"))"
+
"}
order by
?relation"
,
BaseURI
.
ontology
(),
BaseURI
.
role
(),
uri
.
getUri
());
+
"}
ORDER BY
?relation"
,
BaseURI
.
ontology
(),
BaseURI
.
role
(),
uri
.
getUri
());
return
QueryFactory
.
create
(
queryString
);
return
QueryFactory
.
create
(
queryString
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment