Splitting exported ttl file into shacl and non-shacl

122 views
Skip to first unread message

Robin Franken

unread,
Mar 19, 2021, 7:58:06 AM3/19/21
to TopBraid Suite Users
Hi there,

I have an ontology which is created by importing a ttl file into TBC Composer FE. This works, and I am able to use it like a sort of viewer, and to make small changes.  In my original file, I split the file based on |Data|SHACL-shapes| This way I can easily validate my instances using a validation tool like shaclplayground, or on my own CLI (screenshot attached to get an impression of what i mean). By just copying and pasting the contents from the "Data" and "Shapes" file into a "Combined" ttl file, which I can easily open in composer. 

However, after making small changes, and saving the file, my original formatting in my ttl file is replaced with the formatting from tbc, which is not bad in itsself, but sorts everything based on A-Z, meaning my shapes and data become tangled. 

My question is: Is there a way to export/save the ontology in seperate ttl files, or seperate the elements within the ttl file based on whether they are shacl shapes or not i.e. preserving the format of the imported TTL file. Before writing complicated SPARQL queries to untangle my file, I was hoping there may be an easier way.
Capture.PNG



Kind regards,
Robin Franken

 



David Price

unread,
Mar 19, 2021, 9:23:33 AM3/19/21
to topbrai...@googlegroups.com
Suggest not doing the copy and paste into one file, and instead using owl:imports in TBC so you can keep them separate.

Best keep schema and data partitioned all the time, and sometimes best to partition schemas and even to partition a set of data.

Cheers,
David

<Capture.PNG>



Kind regards,
Robin Franken

 




--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/f0181477-2273-44c1-aca9-2290b012b27fn%40googlegroups.com.
<Capture.PNG>


Irene Polikoff

unread,
Mar 19, 2021, 10:25:50 AM3/19/21
to topbrai...@googlegroups.com
To add to David’s response:

Is there a way to export/save the ontology in seperate ttl files

There is no Export option that will split your file into an ontology (shapes) file and data file. 

There are features in TBC that help you to split them, but I don’t think they are available in TBC-FE. You could always just copy a file and remove what you don’t need from each copy. This works more straight forward when removing data - simply select and delete all instances in the Instances view.

However, it sounds like you already did the splitting.

Now, give these files two different names and use different base URIs for each. Include the ontology portion into the data file by using owl:imports. In TBC, you can simply open one file and drag the other one into the Imports view to create this statement.

As David stated, we recommend as the best practice to keep schema/model separate from data.

If you ever wanted to do the reverse and export multiple files as a single merged file, there is an options for merging: Export->TopBraid Composer->Export/Merge/Convert RDF graphs. Not sure if it is present in TBC-FE.

Robin Franken

unread,
Mar 19, 2021, 10:34:33 AM3/19/21
to TopBraid Suite Users
Thank you both for your quick responses! I will explore the import option a bit more, still learning how to use TBC :) Irene, the export function does indeed seem to work in FE also, so I'll keep that in mind in case I ever want to merge the files.

Kind regards,
Robin



Reply all
Reply to author
Forward
0 new messages