You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Scott Streit <sc...@scottstreit.com> on 2013/01/23 23:09:34 UTC

Is there a way to use a wildcard in a field in a model.listStatements

Something like subject* for all subjects starting with something?


-- 
"If you are lucky enough to have lived in Paris as a young man, then
wherever you go for the rest of your life, it stays with you, for Paris is
a moveable feast." -  Ernest Hemingway

www.scottstreit.com

Re: Is there a way to use a wildcard in a field in a model.listStatements

Posted by Patrick Logan <pa...@gmail.com>.
FWIW this seems like information to be pre-processed and then represented
explicitly in a graph.

Any such pre-processed candidate could be so represented as a member of a
class, e.g. including a statement like:

<some-subject> a ex:InterestinglyDesignated

...then you get the full power of the graph implementation and the full
clarity of a graph representation.


On Wed, Jan 23, 2013 at 2:09 PM, Scott Streit <sc...@scottstreit.com> wrote:

> Something like subject* for all subjects starting with something?
>
>
> --
> "If you are lucky enough to have lived in Paris as a young man, then
> wherever you go for the rest of your life, it stays with you, for Paris is
> a moveable feast." -  Ernest Hemingway
>
> www.scottstreit.com
>

Re: Is there a way to use a wildcard in a field in a model.listStatements

Posted by Chris Dollin <ch...@epimorphics.com>.
On Wednesday, January 23, 2013 04:09:34 PM Scott Streit wrote:
> Something like subject* for all subjects starting with something?

(Don't leave parts of the question lost in the subject line -- ask the
whole thing in the message body).

You can write a filter on the result of the listSubjects. It won't be indexed
or anything (probably neither would a corresponding SPARQL query)
and you can write whatever code you find convenient. Then use
filterKeep or filterDrop to apply the filter to the listStatements iterator.

Chris

-- 
"It does not need to take events in their correct order."             /Hexwood/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)


Re: Is there a way to use a wildcard in a field in a model.listStatements

Posted by ashish nijhara <ni...@gmail.com>.
I guess a SPARQL query would be the only bet.

Thanks,
Ashish

On Thu, Jan 24, 2013 at 6:09 AM, Scott Streit <sc...@scottstreit.com> wrote:

> Something like subject* for all subjects starting with something?
>
>
> --
> "If you are lucky enough to have lived in Paris as a young man, then
> wherever you go for the rest of your life, it stays with you, for Paris is
> a moveable feast." -  Ernest Hemingway
>
> www.scottstreit.com
>

Re: Is there a way to use a wildcard in a field in a model.listStatements

Posted by Milorad Tosic <mb...@yahoo.com>.
Hi,

There is a kind of conceptual impedance mismatch in this question. Here is why: Subjects in RDF may be resources or blank nodes. Resources are identified by URIs while blank nodes are a special kind of 'non-existing' resources (that do not have global identity assigned). So, it doesn't make any sense to ask whether 'a subject is starting with something' because there is nothing in the resource definition that may start with anything. However, if we continue with trying to interpret your question then we may come up with two possible interpretations: 
1) "... for all subject URIs starting with something" and 
2) "... for all subjects in the triples where object is a stings starting with something"
In the first case, we would like to find out whether a resource is defined in a given domain, or subpath, or something similar. In the second case, we may want to retrieve all resources that are subjects of triples where predicate is dc:title or rdfs:labele or skos:prefLabel while object of the triple is a stirng starting with 'The*' for example.

Hope it is helpful.

Regards,
Milorad





>________________________________
> From: Scott Streit <sc...@scottstreit.com>
>To: users@jena.apache.org 
>Sent: Wednesday, January 23, 2013 11:09 PM
>Subject: Is there a way to use a wildcard in a field in a model.listStatements
> 
>Something like subject* for all subjects starting with something?
>
>
>-- 
>"If you are lucky enough to have lived in Paris as a young man, then
>wherever you go for the rest of your life, it stays with you, for Paris is
>a moveable feast." -  Ernest Hemingway
>
>www.scottstreit.com
>
>
>