Re: Transformation to RDF reification

Hi Dominik,

CWM [1] and EYE [2] can to do such a job.
All you need is a query like

$ cat rdfrei.n3 
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

{?S ?P ?O} => {_:a rdf:type rdf:Statement; rdf:subject ?S; rdf:predicate 
?P; rdf:object ?O}.

and run

$ cwm dominik.n3 --filter=rdfrei.n3
#Processed by Id: cwm.py,v 1.197 2007/12/13 15:38:39 syosi Exp 
        #    using base file:///home/jdroo/temp/dominik.n3
 
#  Notation3 generation by
#       notation3.py,v 1.200 2007/12/11 21:18:08 syosi Exp

#   Base was: file:///home/jdroo/temp/dominik.n3
     @prefix : <http://example.org/try#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
 
      [      a rdf:Statement;
             rdf:object :o2;
             rdf:predicate :p2;
             rdf:subject :s2 ].
 
      [      a rdf:Statement;
             rdf:object :o1;
             rdf:predicate :p1;
             rdf:subject :s1 ].
 
#ENDS


and same for EYE

$ eye --nope dominik.n3 --query rdfrei.n3
Id: euler.yap 5656 2012-09-26 12:45:21Z josd
YAP 6.2.3 (i686-linux): Sat Jun 16 23:34:26 CEST 2012
starting 40 [msec cputime] 41 [msec walltime]
GET file:///home/jdroo/temp/dominik.n3 SC=2
GET file:///home/jdroo/temp/rdfrei.n3 SC=1
networking 0 [msec cputime] 2 [msec walltime]
TC=2 TP=4 BC=0 BP=3 PM=0 CM=0 FM=0 AM=0
reasoning 0 [msec cputime] 1 [msec walltime]

#Processed by Id: euler.yap 5656 2012-09-26 12:45:21Z josd
#eye --nope dominik.n3 --query rdfrei.n3

@prefix : <http://example.org/try#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix var: <http://localhost/var#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.

_:sk0 a rdf:Statement. _:sk0 rdf:subject :s1. _:sk0 rdf:predicate :p1. 
_:sk0 rdf:object :o1.
_:sk1 a rdf:Statement. _:sk1 rdf:subject :s2. _:sk1 rdf:predicate :p2. 
_:sk1 rdf:object :o2.

#ENDS 0 [msec] TC=2 TP=4 BC=0 BP=3 PM=0 CM=0 FM=0 AM=0


Hope this helps :-)
Jos

[1] http://www.w3.org/2000/10/swap/doc/cwm
[2] http://eulersharp.sourceforge.net/README#eye



Kind Regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618 | F  +32 3 444 8211 | M  +32 494 56 03 95

http://www.agfahealthcare.com
http://blog.agfahealthcare.com
R.O.: Septestraat 27, B-2640 Mortsel, Belgium | RLE Antwerp | VAT BE 
0403.003.524 | IBAN Operational Account BE81363012356224 | IBAN Customer 
Account BE20375104592856 | ING Belgium NV, B-1000 Brussels
Click on link to read important disclaimer: 
http://www.agfahealthcare.com/maildisclaimer 



From:   Dominik Tomaszuk <ddooss@wp.pl>
To:     Liste SW-W3C <semantic-web@w3.org>
Date:   26/09/2012 20:25
Subject:        Transformation to RDF reification



Hi all,

Does anyone know a tool for transforming from normal RDF to RDF with 
reification?

I mean:

:s1 :p1 :o1 .
:s2 :p2 :o2 .

transform to:

_:a rdf:type rdf:Statement .
_:a rdf:subject :s1 .
_:a rdf:predicate :p1 .
_:a rdf:object :o1 .
_:b rdf:type rdf:Statement .
_:b rdf:subject :s2 .
_:b rdf:predicate :p2 .
_:b rdf:object :o2 .

Supported syntaxes are irrelevant.

Best,
Dominik

Received on Wednesday, 26 September 2012 19:34:13 UTC