R3000
(R3000)
March 26, 2019, 3:21pm
1
In the SMS cars.ttl example I see the following:
:Car-{_ROW_} a vso:Automobile, gr:ActualProductOrServiceInstance ;
rdfs:label "{Make} {Model} ({Year})" ;
gr:hasManufacturer :Manufacturer-{#Make} ;
gr:hasMakeAndModel :Model-{#Model} ;
vso:modelDate "{Year}-01-01"^^xsd:date .
Is it possible to place an if condition so that only for the first row in the CSV such a triple is created?
Thanks,
Radu
jess
(Jess Balint)
March 26, 2019, 3:23pm
2
Hi Radu,
What would that accomplish?
Jess
R3000
(R3000)
March 26, 2019, 3:25pm
3
My example is not car related. What I need is to add another type to the subject instance if row=1.
jess
(Jess Balint)
March 26, 2019, 3:26pm
4
You would have to perform this using a SPARQL update:
insert { ?x a :NewType }
where {
# conditions on ?x
}
Hope this helps.
Jess
R3000
(R3000)
March 26, 2019, 3:31pm
5
So no if condition in stardog mapping syntax yet ...
One more idea - is to add an extra column in (each) csv with only one value in the first row for that column. Then make the corresponding change in ttl.
Is _ROW_
something you can use in mappings? I don't recall having seen it in the docs.
jess
(Jess Balint)
March 26, 2019, 5:36pm
7
It looks like _ROW_
and _UUID_
are currently only documented in the example: https://github.com/stardog-union/stardog-examples/blob/develop/examples/cli/virtual/csv/cars_mappings.ttl#L31
I will add them to the docs. Thanks.
1 Like
system
(system)
Closed
April 9, 2019, 5:43pm
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.