You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by DAVID PATTERSON <pa...@me.com> on 2012/04/27 17:16:12 UTC

Finding orphans

If I make an error in building a set of data in a ttl file and have

:x            a              :Something ;
…

Where “Something” is not defined elsewhere in the data, is there an easy way to find it?

 I guess I could get a list of all resources and see if they were only subclasses of rdf:Resource and use that to make the decision, but is there an easier way?

Thanks.

Dave Patterson 

 

Re: Finding orphans

Posted by DAVID PATTERSON <pa...@me.com>.
Great! Thanks.

Dave P

On Apr 27, 2012, at 12:17 PM, Andy Seaborne <an...@apache.org> wrote:

> On 27/04/12 16:16, DAVID PATTERSON wrote:
> > If I make an error in building a set of data in a ttl file and have
> >
> > :xa:Something ;
> > …
> >
> > Where “Something” is not defined elsewhere in the data, is there an easy
> > way to find it?
> >
> > I guess I could get a list of all resources and see if they were only
> > subclasses of rdf:Resource and use that to make the decision, but is
> > there an easier way?
> >
> > Thanks.
> >
> >
> > Dave Patterson
>
> Maybe:
>
> SELECT *
> {
> ?x a ?something
> FILTER NOT EXISTS { ?something ?p ?o }
> }
>
> would return ?x where somehtign is not used as a subject.
>
> Andy
>
> >
> >
>

Re: Finding orphans

Posted by Andy Seaborne <an...@apache.org>.
On 27/04/12 16:16, DAVID PATTERSON wrote:
> If I make an error in building a set of data in a ttl file and have
>
> :xa:Something ;
> …
>
> Where “Something” is not defined elsewhere in the data, is there an easy
> way to find it?
>
> I guess I could get a list of all resources and see if they were only
> subclasses of rdf:Resource and use that to make the decision, but is
> there an easier way?
>
> Thanks.
>
>
> Dave Patterson

Maybe:

SELECT *
{
    ?x a ?something
    FILTER NOT EXISTS { ?something ?p ?o }
}

would return ?x where somehtign is not used as a subject.

	Andy

>
>