Re: How to use ontModel.listHierarchyRootClasses() properly

2019-09-05 Thread Lorenz Buehmann
yes SPARQL is indeed possible. But in that case, I'd go the SPARQL 1.1 way: |SELECT DISTINCT  ?s|| ||WHERE|| ||  { ?s  a  owl:Class|| ||    FILTER ( ! isBlank(?s) )|| ||    FILTER ( ?s NOT IN (owl:Thing, owl:Nothing) )|| ||    FILTER NOT EXISTS { ?s  rdfs:subClassOf  ?super|| ||  

Re: Jena Lucene full text search return no results

2019-09-05 Thread Alex To
I figured it out, I need to include GRAPH ?g in the query Thanks On Fri, Sep 6, 2019 at 2:08 PM Alex To wrote: > > Hi > > I created a Jena Lucene index with this configuration > > var entDef = new EntityDefinition( > "uri", > "label", > "graph", RDFS.label.asNode()); >

Jena Lucene full text search return no results

2019-09-05 Thread Alex To
Hi I created a Jena Lucene index with this configuration var entDef = new EntityDefinition( "uri", "label", "graph", RDFS.label.asNode()); entDef.setLangField("lang"); entDef.setUidField("uid"); Then I loaded schema.org ontology and queried using Lucene API directly on

Re: How to use ontModel.listHierarchyRootClasses() properly

2019-09-05 Thread Alex To
Thanks Lorenz I figured out the union thing too so I ended up using the below SPARQL instead and it seems to work fine but would love to know what is the equivalent using Jena API "SELECT DISTINCT ?s WHERE { " + "?s a owl:Class . " + "FILTER (!isBlank(?s)) " + "FILTER (?s

Re: Parsing RDFNode.toString()-s (back) to RDFNodes -- or parsing GROUP_CONCAT to RDFLists

2019-09-05 Thread Martin G . Skjæveland
Thanks everyone for pointers and ideas! I found Node NodeFactoryExtra.parseNode(String nodeString, PrefixMap pmap) which might be what I am looking for:   https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/sparql/util/NodeFactoryExtra.html Initial tests reveal that it corre

Re: Parsing RDFNode.toString()-s (back) to RDFNodes -- or parsing GROUP_CONCAT to RDFLists

2019-09-05 Thread Claude Warren
I am not certain, but I think that the QueryBuilder AbstractQueryBuilder class has static methods that take objects and create nodes from them. I think that passing the string representation the '<' and '>' prefix and suffix will work for URLs. If you have names like dc:name and "dc" is prefixma

Re: is it possible to combine kleene paths and rules?

2019-09-05 Thread Dave Reynolds
Hi James, On 05/09/2019 09:19, james anderson wrote: good morning; On 2019-09-05, at 09:46:27, Dave Reynolds wrote: Hi, In principle, I could imagine it would be possible to allow property paths in the predicate position in body patterns. yes, that i would expect. i am interested in the

Re: How to use ontModel.listHierarchyRootClasses() properly

2019-09-05 Thread Lorenz Buehmann
schema.org contains a bunch of anonymous classes like the union of other classes which are used as domain or range of a property, that's why you get null values because they do not have a URI. If you'd just call  |System.out.println(clazz);| you'd see the blank node Ids. Among all those blank

Re: Parsing RDFNode.toString()-s (back) to RDFNodes -- or parsing GROUP_CONCAT to RDFLists

2019-09-05 Thread Andy Seaborne
There isn't any better way if the list is being buiolt by teh query. If it is finding a list then ... If your query is local, the app can query to find the head of the list then use the API and work with an RDFList If it's remote, then find use of the use of the list (one query) and do a DES

Re: is it possible to combine kleene paths and rules?

2019-09-05 Thread james anderson
good morning; > On 2019-09-05, at 09:46:27, Dave Reynolds wrote: > > Hi, > > In principle, I could imagine it would be possible to allow property paths in > the predicate position in body patterns. yes, that i would expect. i am interested in the other variant: where the effect of a predicate

Re: is it possible to combine kleene paths and rules?

2019-09-05 Thread Dave Reynolds
Hi, In principle, I could imagine it would be possible to allow property paths in the predicate position in body patterns. Personally I'm not aware of any work like this. Dave On 03/09/2019 09:40, James Anderson wrote: good morning; has there been any experience combining the general purpo