You cannot. SPARQL is based on pattern matching.

But why would you need to? Maybe back up and explain that.

On Thu, Feb 21, 2019 at 6:32 AM ganesh chandra
<ganesh.umesh...@gmail.com> wrote:
>
> Thanks fo the solution. I was hoping if there was some way we can write
> something iterative in the query.
>
> Thanks,
> Ganesh
>
> On Wed, Feb 20, 2019 at 9:28 PM Paul Tyson <phty...@sbcglobal.net> wrote:
>
> > On Wed, 2019-02-20 at 17:27 -0700, ganesh chandra wrote:
> > > Hello All,
> > > My data looks something like this:
> > > <http://www.example.com/example/123456789> a something:Entity ;
> > >     something:privateData [ a something:PrivateData ;
> > >             something:jsonContent "{\"fileType\": \”jp\"}"^^xsd:string ;
> > >           something:modeData [a something:data1
> > >           system:code 1234]
> > >             something:system <http://www.test.edu/fileType> ] ;
> > >
> > > There are many like the above one and I am trying to write the query to
> > delete all the data if the id matches. How I should I go about doing this?
> > >
> >
> > If the data is always in this shape, something like this should work:
> >
> > prefix something: <http://something.example.org>
> > prefix system: <http://system.example.org>
> > DELETE WHERE {
> > <http://www.example.com/example/123456789> a something:Entity ;
> >     something:privateData ?_a.
> > ?_a  a something:PrivateData ;
> >             something:jsonContent ?json ;
> >             something:modeData ?_b;
> >             something:system ?filetype .
> > ?_b a something:data1;
> >             system:code ?code.
> >             }
> >
> > This just replaces the blank nodes with sparql variables.
> >
> > It's a good idea to test DELETE updates thoroughly, because they can
> > often cause surprises. One way to see what will be deleted is to change
> > the DELETE to SELECT and run it as a query. That will show you exactly
> > what triples will be deleted.
> >
> > Regards,
> > --Paul
> >
> >
> > --
> Ganesh Chandra S

Reply via email to