CSV and language literals

1 view
Skip to first unread message

nata...@gmail.com

unread,
Feb 15, 2016, 6:30:18 AM2/15/16
to Stardog
Hello,

I am trying to import a CSV and have set 2 columns which are skos:prefLabel. One with and one without language code.

Here is part of R2RML mapping.

 rr:predicateObjectMap [
  rr:predicate skos:prefLabel;
  rr:objectMap [ rr:column "Description en"; rr:language "en" ]
 ];
 rr:predicateObjectMap [
  rr:predicate skos:prefLabel;
  rr:objectMap [ rr:column "Code" ]
 ];

It can import the data from CSV file but does not assign the language label.

Output is something like

example:0100 a skos:Concept ;
 skos:prefLabel "Major Failure"^^rdf:langString , "0100" .

Which is weird. Any idea what I am doing wrong?

Thx N

Zachary Whitley

unread,
Feb 15, 2016, 6:40:06 AM2/15/16
to sta...@clarkparsia.com
Is there anything in stardog.log? (It's located in $STARDOG_HOME)


Thx N

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

nata...@gmail.com

unread,
Feb 15, 2016, 6:54:57 AM2/15/16
to Stardog
Nope, nothing in the logs. No recent error messages.
It seems that during import it treats the whole column as a language. Which is not what it should do.

You can verify with an example though.

csv file contents

Description en;Code
Major Failure;0100
Minor Failure;0200

configuration properties contents

csv.separator=;

r2rml mapping file contents


<CvsMap>
 a rr:TriplesMap;
 rr:logicalTable [ rr:tableName "failure_mode" ];
 rr:subjectMap [
  rr:template "http://example.com/failure/{Code}" ;
  rr:class skos:Concept
 ];

 rr:predicateObjectMap [
  rr:predicate skos:prefLabel;
  rr:objectMap [ rr:column "Description en"; rr:language "en" ]
 ];
 rr:predicateObjectMap [
  rr:predicate skos:prefLabel;
  rr:objectMap [ rr:column "Code" ]
 ];
.

N

Zachary Whitley

unread,
Feb 15, 2016, 8:32:36 AM2/15/16
to sta...@clarkparsia.com
I'll see if I can reproduce it when I get a chance. Nothing is jumping out just looking at it except *maybe* the space in the first column header "description en".  You could try quoting it with "\"description en\"". I don't have any really good reason to believe it's the source of the problem but it's something you can quickly try. 

nata...@gmail.com

unread,
Feb 15, 2016, 8:49:07 AM2/15/16
to Stardog
I changed the column to "description" in csv and mapping. No luck.

N

Zachary Whitley

unread,
Feb 15, 2016, 4:47:48 PM2/15/16
to sta...@clarkparsia.com
I was able to reproduce what you're seeing with the r2rml mapping you used and using an equivalent SMS mapping. Looks like some sort of bug related to RDF 1.1. If it is a bug and I'm not just missing something you could probably map it to some other temp predicate and write a rule to get the correct mapping for now. 

nata...@gmail.com

unread,
Feb 16, 2016, 4:56:40 AM2/16/16
to Stardog
Thanks for testing it out Zachary.

I am a bit confused though. Why would it be a bug related to RDF 1.1? I use R2RML to RDBMSs and that works fine for language literals.

Isn't it a bug in the code where someone forgot to pass the value of rr:language in CSV mappings?

N

Zachary Whitley

unread,
Feb 16, 2016, 6:29:46 AM2/16/16
to sta...@clarkparsia.com


On Feb 16, 2016, at 4:56 AM, nata...@gmail.com wrote:

Thanks for testing it out Zachary.

I am a bit confused though. Why would it be a bug related to RDF 1.1? I use R2RML to RDBMSs and that works fine for language literals.


I was completely guessing based on rdf:langString being an RDF 1.1 thing. One of the Stardog people will have to provide the real answer. I'm just here trying to be helpful. 

Natan Cox

unread,
Feb 16, 2016, 7:03:35 AM2/16/16
to sta...@clarkparsia.com
Yes, I noticed and appreciate it very much. But I was under the assumption you had access to the code aka were a Complixible employee.

Sorry about the confusion.

N

You received this message because you are subscribed to a topic in the Google Groups "Stardog" group.
To unsubscribe from this topic, visit https://groups.google.com/a/clarkparsia.com/d/topic/stardog/DfG7wASZf8I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stardog+u...@clarkparsia.com.

Zachary Whitley

unread,
Feb 16, 2016, 7:19:18 AM2/16/16
to sta...@clarkparsia.com


On Feb 16, 2016, at 7:03 AM, Natan Cox <nata...@gmail.com> wrote:

Yes, I noticed and appreciate it very much. But I was under the assumption you had access to the code aka were a Complixible employee.

Sorry about the confusion.

No worries. I'm just an enthusiastic user trying to help.

Evren Sirin

unread,
Feb 16, 2016, 2:50:10 PM2/16/16
to Stardog
Hi Natan,

Thanks for the report. This is a bug in CSV imports and Zachary is
right about the RDF 1.1 connection. This regression bug was introduced
when RDF 1.1 added rdf:langString datatype for language literals.
We'll fix this in the next release.

Best,
Evren

On Tue, Feb 16, 2016 at 7:19 AM, Zachary Whitley

Natan Cox

unread,
Feb 16, 2016, 3:44:04 PM2/16/16
to sta...@clarkparsia.com
Cool! Thx.
Reply all
Reply to author
Forward
0 new messages