Hi Kees,

Splitting is much harder than merging. Merging, of course, is practically no
work at all, while splitting will require some rather detailed steps.

There are multiple ways of accomplishing this including using the triple
view in TBC which gives one a complete control over which triple goes where,
but it is also extremely detailed, especially if the trees are deep.

If this operation needs to be done multiple times, I would recommend
automating it with a SPARQLMotion script. For a manual split, given the
nature of the task, I would probably do something like this:

Copy your file creating 4 identical files - 1, 2, 3 and 4. Open them in a
text editor and give files 2, 3 and 4 different base URIs. For example
www.example.com/branchA for file2. Open file 1 and delete all skos concepts
except for the parent of branches A, B and C. If the parent has any parents
of its own, keep them as well. In other words, keep everything above the
branches you are splitting. Save.

Open file 2 in TBC. Import file 1 into file 2.

Delete branch B  by running a query along these lines:

DELETE {?s ?p ?o. ?s2 ?p ?s}
WHERE {s skos:broader+ :B.
?s ?p ?o.
OPTIONAL {?s2 ?p ?s}}

Prior to doing the delete, run a CONSTRUCT query to see all triples that
will be deleted and to confirm that you are deleting the right things.

Do the same delete for branch C.

Make :A skos:broader :common-parent.

Repeat this for files 3 and 4 so that they only contain branches B and C
respectively.

This should work if there are no connections across the brunches. If there
are, the queries and the process would need to be adjusted to preserve
these. 

Regards,

Irene

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Henninger
Sent: Thursday, August 12, 2010 10:40 AM
To: TopBraid Suite Users
Subject: [topbraid-users] Re: Split SKOS model into multiple rdf SKOS files

Kees; There is a general section on refactoring in Help > How to? >
Refactor ontologies.  The specific section for this question is "Move
resources between files", which gives a couple of options on how to do
this.

If this doesn't meet you needs, let us know.

-- Scott

On Aug 12, 8:12 am, DrKK <[email protected]> wrote:
> Hi,
>
> I have a model in SKOS and want to split the model in separate rdf
> files. I would like to have all the newly created files having the
> properties from the source file, but the toplevel instances separated.
> So the new files have al the properties but separate branches. For
> example, source has ABC, file 1, file 2, and file 3 have the branch A,
> B and C respectively. What is the best way to do this?
>
> thanks
>
> Kees

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to