sheet2rdf export RDF and import into VocBench - blank tree

173 views
Skip to first unread message

Cristian Romanescu

unread,
Aug 18, 2015, 9:11:38 AM8/18/15
to vocbench-user
Hi,

I'm struggling for quite some time today to export an Excel table into RDF so I can import it into VocBench ontology

The excel has two columns:

|   skos:Concept | skos:prefLabel |
|                1        |           test         |


The XML  looks like this:

<rdf:Description rdf:about="http://www.cbd.int/glossary/#1">
<skos:inScheme rdf:resource="http://www.cbd.int/glossary/#"/>
<skos:prefLabel>test</skos:prefLabel>
<skos:broader rdf:resource="http://www.cbd.int/glossary/#test"/>
</rdf:Description>

But, when I import the terms into Vocbench, it says "Import successful", even though the concept tree is empty. The concept is there, because I can see it using SPARQL query.

Can you please provide some guidance? I've read over the forum and seems I need to use some utility to reify the labels.

I see the "Refactor" menu under "Global data management", where it says SKOS to SKOSXL conversion, but I get a cryptical message and nothing happens, see screenshot.
Using VB 2.3



Thanks,
Cristian

Armando Stellato

unread,
Aug 18, 2015, 10:30:13 AM8/18/15
to Cristian Romanescu, vocbench-user
Dear Cristian,

Unfortunately (as reported in a previous msg), the reification utility does not work due a trivial but deadly mistake in the service call from VB to the ST server. It'll come back fixed in 2.4.

I cannot access the history of our mailing list on google groups as I'm in China and..well...no google ;) however you can search the list on google groups and check some solutions I provided there (such as invoking directly the proper service on ST, or using directly some command line utility we provide).

In any case, as I see from the subject of the email, it seems you are using sheet2rdf right? In that case, it suffices to change the PEARL code in order to produce a reified SKOSXL label directly from there (check the triples in the GRAPH section of the PEARL code automatically produced by sheet2rdf, and modify it to introduce the skosxl label).

Cheers,

Armando

Da: Cristian Romanescu
Inviato: ‎18/‎08/‎2015 21:13
A: vocbench-user
Oggetto: [vocbench-user] sheet2rdf export RDF and import into VocBench - blank tree

--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
Visit this group at http://groups.google.com/group/vocbench-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/f0cb43e7-652a-4f5e-b1a1-fb7fa146501d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cristian Romanescu

unread,
Aug 18, 2015, 11:55:33 AM8/18/15
to vocbench-user, cristian....@gmail.com
Hi Armando,

Thanks for the time to answer. 
I'm having a hard time trying to configure the utility it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter 

There is no documentation on what to set the modelDataDir, and apparenty the tool does not start without it. So I added modelDataDir=/path/to/SemanticTurkeyData, but I get an exception:

it.uniroma2.art.owlart.exceptions.ModelCreationException: Unable to start transaction: data file is locked or read-only

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadRDFBaseModel(ARTModelFactorySesame2Impl.java:249)

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadSKOSXLModel(ARTModelFactorySesame2Impl.java:355)

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadSKOSXLModel(ARTModelFactorySesame2Impl.java:94)

at it.uniroma2.art.owlart.models.OWLArtModelFactory.loadSKOSXLModel(OWLArtModelFactory.java:302)

at it.uniroma2.art.owlart.models.OWLARTModelLoader.loadSKOSXLModel(OWLARTModelLoader.java:210)

at it.uniroma2.art.owlart.models.OWLARTModelLoader.loadModel(OWLARTModelLoader.java:178)

at it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter.main(SKOS2SKOSXLConverter.java:126)

Exception in thread "main" it.uniroma2.art.owlart.exceptions.ModelCreationException: it.uniroma2.art.owlart.exceptions.ModelCreationException: Unable to start transaction: data file is locked or read-only

at it.uniroma2.art.owlart.models.OWLARTModelLoader.loadSKOSXLModel(OWLARTModelLoader.java:216)

at it.uniroma2.art.owlart.models.OWLARTModelLoader.loadModel(OWLARTModelLoader.java:178)

at it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter.main(SKOS2SKOSXLConverter.java:126)

Caused by: it.uniroma2.art.owlart.exceptions.ModelCreationException: Unable to start transaction: data file is locked or read-only

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadRDFBaseModel(ARTModelFactorySesame2Impl.java:249)

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadSKOSXLModel(ARTModelFactorySesame2Impl.java:355)

at it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl.loadSKOSXLModel(ARTModelFactorySesame2Impl.java:94)

at it.uniroma2.art.owlart.models.OWLArtModelFactory.loadSKOSXLModel(OWLArtModelFactory.java:302)

at it.uniroma2.art.owlart.models.OWLARTModelLoader.loadSKOSXLModel(OWLARTModelLoader.java:210)

... 2 more



Can you please clarify this parameter? I cloned the owlart repo, checked here http://grepcode.com/file/repo1.maven.org$mav...@it.uniroma2.art.owlart$owlart-api@2.3@it$uniroma2$art$owlart$models$BaseRDFModelTest.java, to no avail.


Thanks,

Cristian

Armando Stellato

unread,
Aug 18, 2015, 12:51:03 PM8/18/15
to Cristian Romanescu, vocbench-user
Dear Cristian,

As soon as I am back home (21st of August) I can give some mote direct help.

For now, I can tell you that is normal that it returns you a lock as the data there is being accessed by ST.

Actually with the utilities you can take an existing file (the one you produced with sheet2rdf) and generate a "processed" file in output. For the datafolder just use an existing empty folder, as the data you need to process is in the input file and this folder will (depending on the kind of model) only store information produced during the process, but you don't need to use it, as everything will be in the output file.

If (as suggested in: http://art.uniroma2.it/owlart/documentation/utilities.jsf#setup )
you download this distribution:
https://bitbucket.org/art-uniroma2/owlart/downloads/owlart-2.3-dist.zip

you will find already prepared batches for almost all the utilities listed in the page you mentioned.

Hope this helps!

Cheers,

Armando

Da: Cristian Romanescu
Inviato: ‎18/‎08/‎2015 23:57
A: vocbench-user
Cc: cristian....@gmail.com
Oggetto: Re: [vocbench-user] sheet2rdf export RDF and import into VocBench - blank tree

Cristian Romanescu

unread,
Aug 19, 2015, 8:25:57 AM8/19/15
to vocbench-user, cristian....@gmail.com
Hi Armando,

Thanks for the guidelines, I downloaded and used owlart-2.3 and the export worked, I see the labels reified, however when I import into VocBench the XML, I still don't see any concepts.

I have attached all the files, maybe you can have a look:

* CBD.xls - I have prepared the Excel with column heading as in example from shee2rdf-1.1.1
* CBD.rdf - The output from sheet2rdf
* CBD.rdf.xml - The output from skos2skosxl

Few issues worth mentioning:

1) There is a # in the exported XML namespaces (http://www.cbd.int/glossary/#), not sure if it's fine. Appears even if skosInScheme parameter is empty. So you get a baseUri namespace like: 

http://www.cbd.int/#my-own-term, instead of http://www.cbd.int/my-own-term - But that's easy to fix with a search and replace in file.



2) Due to a bug in skos2skosxl tool, I had to replace <skos:prefLabel> with <skos:prefLabel xml:lang="en"> in CBD.rdf, otherwise I get the exception below:


$ ./skos2skosxl.sh _config/CBD-convert.properties ../sheet2rdf-1.1.1/_rdf/CBD.rdf ../sheet2rdf-1.1.1/_rdf/CBD.rdf.xml

log4j:WARN No appenders could be found for logger (it.uniroma2.art.owlart.sesame2impl.factory.ARTModelFactorySesame2Impl).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Exception in thread "main" java.lang.IllegalArgumentException: the <lang> argument to this method must not be null!

at it.uniroma2.art.owlart.models.impl.SKOSXLModelImpl.createRandomURI4XLabel(SKOSXLModelImpl.java:493)

at it.uniroma2.art.owlart.models.impl.SKOSXLModelImpl.addXLabel(SKOSXLModelImpl.java:96)

at it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter.convert(SKOS2SKOSXLConverter.java:97)

at it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter.convert(SKOS2SKOSXLConverter.java:49)

at it.uniroma2.art.owlart.utilities.transform.SKOS2SKOSXLConverter.main(SKOS2SKOSXLConverter.java:133)


3) You mentioned editing the PEARL script ... with sheet2rdf, I see the file pearl_CBD_xls.pr is always overwritten and what I write there is lost.
I don't really know how to do that, found no documentaition on this and on the .pr languaguage. Maybe this can be improved.


For now - to get the job done, I'm writing a simple script to generate the RDF from CSV exported file, it's a trivial structure, shouldn't take too much.

Thanks for the support!
Cristian


On Tuesday, August 18, 2015 at 7:51:03 PM UTC+3, Armando Stellato wrote:
Dear Cristian,



Can you please clarify this parameter? I cloned the owlart repo, checked here http://grepcode.com/file/repo1.maven.org$maven2@it.uniroma2.art.owlart$owlart-api@2.3@it$uniroma2$art$owlart$models$BaseRDFModelTest.java, to no avail.

CBD.rdf.xml
CBD.xls
CBD.rdf

Cristian Romanescu

unread,
Aug 19, 2015, 12:12:28 PM8/19/15
to vocbench-user, cristian....@gmail.com
In case anyone is interested for a quick conversion from CSV/Excel to SKOSXL, here's a Gist I've made: https://gist.github.com/cristiroma/ff41396197879d9cb6c8

Armando Stellato

unread,
Sep 9, 2015, 7:02:47 AM9/9/15
to Cristian Romanescu, vocbench-user

Dear Cristian, dear all,

 

sorry for coming later to this, just we italians have holidays on August, when the rest of the world is back from their July vacations, and this means traveling with connection on, and still really leaving tons of messages for when we are back.

 

I took your case, and tested with your files, so…

…no worries, no panic, everything works :)

 

point by point, following your email:

 

 

 

1) There is a # in the exported XML namespaces (http://www.cbd.int/glossary/#), not sure if it's fine. Appears even if skosInScheme parameter is empty. So you get a baseUri namespace like: 

http://www.cbd.int/#my-own-term, instead of http://www.cbd.int/my-own-term - But that's easy to fix with a search and replace in file.

 

Yes this is the only true bug (now fixed for the next version). Note that also on the current stable version, if you use sheet2rdf from inside its Semantic Turkey extension on Firefox (instead of the command line tool), this bug is not present. In any case, it can be easily solved with a replace-all as you say.

 

 

2) Due to a bug in skos2skosxl tool, I had to replace <skos:prefLabel> with <skos:prefLabel xml:lang="en"> in CBD.rdf, otherwise I get the exception below:

 

Well, yes the skos2skoxl requires the language. But, why not language there? You could add the language to the PEARL (see point 3 below) or, since you didn’t know how to use a customized PEARL, add it directly in the header of the Excel, as described here:

http://art.uniroma2.it/sheet2rdf/documentation/heuristics.jsf

 

 

3) You mentioned editing the PEARL script ... with sheet2rdf, I see the file pearl_CBD_xls.pr is always overwritten and what I write there is lost.

I don't really know how to do that, found no documentaition on this and on the .pr languaguage. Maybe this can be improved.

 

Yes you are right it is missing from the docs (we will add it), but the .properties file you were editing should contain also this line with the comment on it

 

#path of the input pearl file (optional, if not provided, Sheet2RDF will try to generate a pearl file)

#inputPearlFile=pearl.pr

 

If you decomment the property, you can set the pearl file to use.

 

 

Cheers,

 

Armando

 

Armando Stellato

unread,
Sep 9, 2015, 2:27:21 PM9/9/15
to Cristian Romanescu, vocbench-user

Ops..sorry, I forgot to mention one thing:

 

You could produce skosxl:Labels without any need to use the converter. Apart from the PEARL (see again point 3), you could specifiy yet them from the Excel file, in the header, by typing:

 

skosxl:prefLabel (alt/hidden), instead of skos:pref/alt/hiddenLabel.

 

And then the lag tag, as I said, in between brackets.

 

Cheers,


Armando

 

Da: outlook_2866...@outlook.com [mailto:outlook_2866...@outlook.com] Per conto di Armando Stellato
Inviato: mercoledì 9 settembre 2015 13:02
A: 'Cristian Romanescu' <cristian....@gmail.com>; 'vocbench-user' <vocben...@googlegroups.com>
Oggetto: R: [vocbench-user] sheet2rdf export RDF and import into VocBench - blank tree

Reply all
Reply to author
Forward
0 new messages