On 12/7/12 7:06 AM, Vishesh Handa wrote:

Thanks for the link, however the proposed method of moving triples from one graph to another assumes that the user wants to move all the triples from one graph to another. In my case I just need to move a particular subset of triples from one graph to another.

Also, it seems to be an overkill to remove triples from the database and re-insert them when I just need to be changing their graph parameter. Do you think I could use the tip give over here [1] with an additional where clause to specify the triples?

You can use SPARQL 1.1 Update syntax to source triples from one Named Graph IRI that are INSERTED into another.

## Project Related Items Ontology

## URI: http://vocab.deri.ie/pdo
## URL: http://vocab.deri.ie/pdo.ttl

INSERT INTO <http://vocab.deri.ie/pdo.ttl>
            {     ?s rdfs:isDefinedBy <http://vocab.deri.ie/pdo> .
<http://vocab.deri.ie/pdo> <http://open.vocab.org/terms/defines> ?s.
                <http://vocab.deri.ie/pdo> a owl:Ontology .
?s <http://www.w3.org/2007/05/powder-s#describedby> <http://vocab.deri.ie/pdo.ttl> .
                <hhttp://vocab.deri.ie/pdo.ttl> foaf:primaryTopic ?s.
            }
FROM <http://vocab.deri.ie/pdo.ttl>
WHERE {   {?s rdfs:subClassOf ?o}
          UNION
          {?s rdfs:subPropertyOf ?o}
          UNION
          {?s owl:equivalentClass ?o}
          UNION
          {?s owl:equivalentProperty ?o}
          UNION
          {?s a ?o}
        }

## SPARQL 1.1 Variant

INSERT {GRAPH <http://vocab.deri.ie/pdo.ttl>
            {    ?s rdfs:isDefinedBy <http://vocab.deri.ie/pdo> .
<http://vocab.deri.ie/pdo> <http://open.vocab.org/terms/defines> ?s.
                <http://vocab.deri.ie/pdo> a owl:Ontology .
?s <http://www.w3.org/2007/05/powder-s#describedby> <http://vocab.deri.ie/pdo.ttl> .
                <http://vocab.deri.ie/pdo.ttl> foaf:primaryTopic ?s .
            }
        }
WHERE {GRAPH <http://vocab.deri.ie/pdo.ttl> {
                                                {?s rdfs:subClassOf ?o}
                                                UNION
                                                {?s rdfs:subPropertyOf ?o}
UNION {?s owl:equivalentClass ?o} UNION {?s owl:equivalentProperty ?o}
                                                UNION {?s a ?o}
                                            }
    }


--

Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter/Identi.ca handle: @kidehen
Google+ Profile: https://plus.google.com/112399767740508618350/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen





Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to