Using ConvertXMLByXSLT module

50 views
Skip to first unread message

Oleksandr Mandryk

unread,
Apr 6, 2017, 7:03:40 AM4/6/17
to TopBraid Suite Users
Hi,
As a continuation of this topic I'm wondering which SPARQLMotion modules I have to use to build 
a script that retrieves taxonomy, converts it to XML using RDFXML serialization and then converts it to another XML using ConvertXMLByXSLT module.

I've tried to do it like this:


but it doesn't work, because ConvertXMLByXSLT module throws an exception with the message "Caused by: org.topbraid.spin.sparqlmotion.modules.SMException: Expected XML value for variable xml"

So I have few questions:

1) What I can use instead of ReturnRDF to apply RDFXML serialization and return the result as a variable (that is needed for ConvertXMLByXSLT module)?

2) Is it possible to use filename/filepath in the template property of ConvertXMLByXSLT instead of putting whole schema to this property?

Thank you!

Best regards,
Oleksandr Mandryk

Richard Cyganiak

unread,
Apr 6, 2017, 12:45:26 PM4/6/17
to topbrai...@googlegroups.com
Hi Oleksandr,

1) You could try writing the RDF/XML to a temporary file, and then reading that file as an XML file with ImportXMLFile.

2) You could try reading the XSLT with ImportXMLFile and passing the result as the template variable for ConvertXMLByXSLT.

Richard


--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oleksandr Mandryk

unread,
Apr 7, 2017, 3:44:12 AM4/7/17
to TopBraid Suite Users
Hi Richard,
thank you for reply!

1) I've checked module "Export to XML file", but there is no property xml:serialization in this module, so I can't apply RDFXML serialization before saving. 
And actually it would be better to do it on the fly in memory, so this question is still open.

2) Looks like it works with "Import text file" module, thank you for hint!

Best regards
Oleksandr Mandryk

Holger Knublauch

unread,
Apr 9, 2017, 7:53:41 PM4/9/17
to topbrai...@googlegroups.com
To produce a string (e.g. RDF/XML) from a graph, you can use the SPARQL function smf:convertRDFToText:

smf:convertRDFToText (spin:Function)

Converts the current RDF graph to text. Optionally the serialization of the RDF graph as text can be given. By default, the serialization is Turtle.

Arguments

sp:arg1 (rdfs:Resource): [Optional] The optional serialization format of the output. By default, it is Turtle. This value should be an instance of "sml:RDFSerialization" from the sparqlmotionlib ontology, for example sml:RDFXML.
sp:arg2 (rdfs:Resource): [Optional] An optional pointer to the URI of a .context.json file - only used for JSON-LD.

Return type

  • string

HTH
Holger

Oleksandr Mandryk

unread,
Apr 10, 2017, 3:48:52 AM4/10/17
to TopBraid Suite Users
Hi Holger,
thank you very much! 

It's exactly what I needed, but looks like there is the same issue with the serialization as it was in ReturnRDF.

Both sml:RDFXML and sml:RDFXMLAbbrev in smf:convertRDFToText produce the same output. Could you please have a look on it?
Thank you!

Best regards,
Oleksandr Mandryk

Holger Knublauch

unread,
Apr 10, 2017, 4:01:10 AM4/10/17
to topbrai...@googlegroups.com
Right. Same regression error as before. Fixed for 5.3 release.

Thanks,
Holger

Oleksandr Mandryk

unread,
Apr 10, 2017, 4:08:48 AM4/10/17
to TopBraid Suite Users
Hi Holger,
thank you for the quick answer!

I'm using EVN Version 5.3.0.v20170320-1626B, do you know if it will be fixed in the next beta? And if yes, do you know when the next beta will be released?
Thank you!

Best regards,
Oleksandr Mandryk

Pat Doyle

unread,
Apr 10, 2017, 8:19:56 AM4/10/17
to TopBraid Suite Users
Oleksandr,

The fix for this should be included in the official 5.3 release, which is currently scheduled for next week - assuming there are no delays.

Regards,
Pat

To post to this group, send email to topbraid-users@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-users+unsubscribe@googlegroups.com.

Oleksandr Mandryk

unread,
Apr 11, 2017, 3:19:17 AM4/11/17
to TopBraid Suite Users
Hi Pat,

ok, thank you for the information.

Best regards,
Oleksandr Mandryk
Reply all
Reply to author
Forward
0 new messages