Martina,

The answer depends on what is in this file.

Is it text that is already RDF? If it is RDF, you do not need any SM modules. 
Simply, rename the file to reflect the serialization and click to open the file 
in TBC. There is no need to run export or anything like that - the file is 
already RDF.

Further, ConvertTextToRDF should be used only if the input text is already RDF. 
This module is used to process a text response from a web service that returns 
RDF serializations. It loads service responses into a graph in TBC. You could 
then use other modules to manipulate the graph and perform any other logic on 
the data you need. This is made clear by its description.

If your file contains a spreadsheet table in tab separated format, then you 
could use Import > TopBraid Composer > Import Tab-Delimited Spreadsheet File. 
There is a wizard that will walk you through conversion.

If it is a free form text that contains some terms that you may want to extract 
as concepts, you can launch TopBraid EDG from TBC and use Import Document 
feature. This requires you to first create a Taxonomy in EDG that will contain 
the extracted concepts. This is just a shell, the taxonomy will be empty. Read 
more at 
https://doc.topquadrant.com/6.4/importing/#Import_Concepts_from_Documents.

If you have a file with some arbitrary text, there its no built-in feature that 
would automagically convert it into structured RDF. You may be able to write 
some custom queries and/or scripts of your own design to turn it into RDF that 
you need. One can't say how complex this would be without knowing the content 
of the file. 

With this approach, you could use ImportTextFile which would load all the 
content of the file into a single variable. This would basically get you to RDF 
where all your text is an object of a single triple - like a large blob. Or you 
could simply cut and paste the text into an object of a triple you create 
without using this module. I asked if you wanted to create a service for a 
reason. If this is to be a repeatable conversion that runs many times, then 
using SM module to load the text would make sense.

You would then need to use SPARQL string functions to extract what you need 
from the text, then create RDF resources based on this. It may, however, be 
easier to do something like this using a scripting language like SWP 
https://www.topquadrant.com/technology/sparql-web-pages-swp/ or ADS 
https://www.topquadrant.com/configuring-topbraid-edg-with-javascript/.

> On Feb 1, 2021, at 10:30 AM, Martina Husáková <martina.husakova...@gmail.com> 
> wrote:
> 
> Good afternoon,
> 
> thank you for your feedback. I do not want to create a service, but I would 
> like simply to convert a text, which is in the file TsunamiText.txt (see the 
> 1st figure/sml:sourceFilePath), into the RDF file.
> I used two modules for this purpose: "Import text file" and "Convert text to 
> RDF" and I would like to know where my mistake is in the settings of these 
> two modules. If I run the script, the second module "Convert text to RDF" 
> becomes yellow. I suppose that there is a mistake in this module.
> 
> You mention that "... you should change the suffix to reflect the 
> serialization e.g., .ttl and click on it to open." If I look into the two 
> modules "Import text file" and "Convert text to RDF", there is no possibility 
> where to include the name of the resulting RDF file with ttl. You can only 
> mention which serialization syntax should be used for converting in the 
> "Convert text to RDF" module (sml: serialization). Yes, I can add the next 
> module, e. g. "Export to RDF file" where I can add the name of the resulting 
> RDF file, but if I run the script, the second module "Convert text to RDF" 
> becomes yellow.
> 
> Best regards and thank you for some advice in advanced,
> Martina
> 
> 
> 
> 
> 
> On Sat, 30 Jan 2021 at 00:06, Irene Polikoff <ir...@topquadrant.com 
> <mailto:ir...@topquadrant.com>> wrote:
> Take a look at Help. This is for the web service interaction.
> 
> sml:ImportTextFile (sm:Module)
> 
> 
> Imports a text file into the xsd:string variable sm:outputVariable.
> 
> sml:sourceFilePath (xsd:string): The path to a text file. The path can be 
> relative to the current script's folder (e.g., myFolder/test.txt) or absolute 
> to the workspace root /myProject/myFolder/test.txt.
> 
> sml:ConvertTextToRDF (sm:Module)
> 
> Converts a text in one of the RDF serializations into an RDF graph. In a 
> typical scenario, the text would be passed into the script as external (web 
> service) input. 
> 
> 
> Is this your scenario? 
> 
> If you are not trying to create a service that will be called, but simply 
> have a file in RDF serialization, you should change the suffix to reflect the 
> serialization e.g., .ttl and click on it to open.
> 
>> On Jan 29, 2021, at 1:34 PM, Martina Husáková <martina.husakova...@gmail.com 
>> <mailto:martina.husakova...@gmail.com>> wrote:
>> 
>> Good afternoon,
>> 
>> may I have a trivial question? I would like to receive the rdf ontology from 
>> the text (in my case TsunamiText.txt). I chose the two modules for this:
>> 1. Import text file 
>> 2. Convert text to RDF
>> 
>> I am really a beginner in TopBraid Composer. I do not know how to say in the 
>> module "Convert text to RDF" that this module should process (convert) the 
>> content of the variable "text" (in a module "Import text file"). 
>> 
>> At present, the TopBraid provides the following message in the Error log: 
>> "Could not execute SPARQLMotion script."  Maybe, different modules should be 
>> used for this problem.
>> 
>> Is there anybody who could help me with this ... I think ... really trivial 
>> problem? :-)
>> Thank you a lot for some advice(s) :-)
>> 
>> Best regards,
>> Martina
>> 
>> P. S. I am attaching two figures depicting my workflow for converting text 
>> -> RDF.
>> 
>> <ModuleImportText.PNG>
>> 
>> <ModuleConvertTxtToRDF.PNG>
>> 
>> 
>> -- 
>> 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+unsubscr...@googlegroups.com 
>> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/f5133492-8962-45d5-9d30-842d363fae1fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/f5133492-8962-45d5-9d30-842d363fae1fn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> <ModuleConvertTxtToRDF.PNG><ModuleImportText.PNG>
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "TopBraid Suite Users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/topbraid-users/F_yUeFTQHSg/unsubscribe 
> <https://groups.google.com/d/topic/topbraid-users/F_yUeFTQHSg/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> topbraid-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/184C69C2-92B9-4E3C-AC1D-58AEACA9FD4E%40topquadrant.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/184C69C2-92B9-4E3C-AC1D-58AEACA9FD4E%40topquadrant.com?utm_medium=email&utm_source=footer>.
> 
> -- 
> 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+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/CAAn62oeRLQrvTxO1jzEM37E_DZBCJ38XDoRDqf%3DJf3UQ4RW1Dg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/CAAn62oeRLQrvTxO1jzEM37E_DZBCJ38XDoRDqf%3DJf3UQ4RW1Dg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/08C065CF-4880-468E-96FB-E4D30F0E1DFB%40topquadrant.com.

Reply via email to