Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
rico-edm-transformer
Commits
246c7cc1
Commit
246c7cc1
authored
Apr 06, 2021
by
Silvia Witzig
Browse files
add placeOfCapture to dcterms:spatial
parent
7756ace7
Pipeline
#24222
passed with stages
in 7 minutes and 16 seconds
Changes
4
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/rico2edm/edm/EDM.scala
View file @
246c7cc1
...
...
@@ -169,6 +169,9 @@ class EDM {
Extractors
.
dcTermsSpatial
(
graph
)(
record
.
value
)
.
foreach
(
c
=>
cho
.
addDcTermsSpatial
(
Some
(
c
)))
Extractors
.
dcTermsSpatialCapture
(
graph
)(
record
.
value
)
.
foreach
(
c
=>
cho
.
addDcTermsSpatial
(
Some
(
c
)))
Extractors
.
dcTermsIssuedTemporal
(
graph
)(
record
.
value
)(
"temporal"
)
.
foreach
(
c
=>
cho
.
addDcTermsTemporal
(
Some
(
c
)))
...
...
src/main/scala/ch/memobase/rico2edm/edm/Extractors.scala
View file @
246c7cc1
...
...
@@ -418,7 +418,7 @@ object Extractors {
}
//todo: multiple property - abwarten Silvia macht!!!
val
dcTermsSpatial
:
JArr
=>
mutable
.
LinkedHashMap
[
String
,
JValue
]
=>
List
[
String
]
=
graph
=>
...
...
@@ -432,6 +432,20 @@ object Extractors {
}.
toList
val
dcTermsSpatialCapture
:
JArr
=>
mutable
.
LinkedHashMap
[
String
,
JValue
]
=>
List
[
String
]
=
graph
=>
record
=>
getAllBlankNodeContent
(
graph
)(
record
)(
"P60556"
)
.
collect
{
case
placeObject
if
placeObject
.
contains
(
"@type"
)
&&
placeObject
(
"@type"
).
str
==
"https://www.ica.org/standards/RiC/ontology#Place"
&&
placeObject
.
contains
(
"name"
)
=>
placeObject
(
"name"
).
str
}.
toList
//todo: @Günter, das kann nicht funktionieren. Bei temporal gibt es kein Place.
val
dcTermsTemporal
:
JArr
=>
mutable
.
LinkedHashMap
[
String
,
JValue
]
=>
List
[
String
]
=
graph
=>
...
...
src/test/resources/fuer.silvia.json
View file @
246c7cc1
This diff is collapsed.
Click to expand it.
src/test/scala/ch/memobase/rico2edm/edm/CHOSpec.scala
View file @
246c7cc1
...
...
@@ -38,6 +38,7 @@ class CHOSpec extends AnyFunSuite with Matchers{
private
lazy
val
ricoRegulatedBy
=
loadFile
(
"src/test/resources/rico.regulatedBy.json"
)
private
lazy
val
ricoNoSourceInRecord
=
loadFile
(
"src/test/resources/raw2.indent.json"
)
private
lazy
val
ricoPlaceCapture
=
loadFile
(
"src/test/resources/fuer.silvia.json"
)
private
lazy
val
ricoCertainty
=
loadFile
(
"src/test/resources/rico.certainty.json"
)
private
lazy
val
ricoDuration
=
loadFile
(
"src/test/resources/rico.duration.json"
)
...
...
@@ -291,6 +292,11 @@ class CHOSpec extends AnyFunSuite with Matchers{
val
spatials
=
Extractors
.
dcTermsSpatial
(
graph
)(
record
)
assert
(
spatials
.
length
==
2
&&
spatials
.
head
==
"Madrid"
&&
spatials
(
1
)
==
"Spagna"
)
val
graph2
=
Extractors
.
jsonGraph
(
ricoPlaceCapture
).
get
.
arr
val
record2
=
Extractors
.
record
(
graph2
).
get
val
spatialsCapture
=
Extractors
.
dcTermsSpatialCapture
(
graph2
)(
record2
)
assert
(
spatialsCapture
.
length
==
1
&&
spatialsCapture
.
head
==
"Genève"
)
}
test
(
"collect dcterms:temporal"
)
{
...
...
Write
Preview
Supports
Markdown
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