Re: [Owlim-discussion] TBox queries

2012-07-12 Thread Barry Norton


+1

But how does such a query work with forward-chaining? (Since the class 
is unknown, therefore hasn't been subjected to the inference rules before)


My first idea was that maybe the class if asserted, reasoning enacted, 
the query answered, then the assertion rolled back... but that's not how 
Sesame transactions work.


I fear your answer might start "that's a totally stupid idea, B2"...

B2



On 12/07/2012 11:13, damyan wrote:

Hi Nicola,

yes, you could query for such - just express these as SPARQL queries

for instance,  a query against wordnet to get all the subclasses of a 
Restriction (wordn-sc:word some  wordn-sc:Word) may look like:


PREFIX wordn-sc: 
PREFIX rdfs: 
PREFIX owl: 

select * where {
?sub rdfs:subClassOf ?c .
?c a owl:Restriction;
owl:onProperty wordn-sc:word;
owl:someValuesFrom wordn-sc:Word .
}

About the supported inference and its limitations, best is to read 
"supported semantics" from the OWLIM Primer document 
 



HTH,
Damyan Ognyanov
Ontotext AD.


On 7/12/2012 10:56 AM, Nicola Vitucci wrote:

Hi all,

I have another question for you :-)

Considering that OWLIM supports the OWL2 QL and RL profiles, what kinds
of TBox queries can be performed? Are queries with anonymous classes
like "find the subclasses/superclasses/equivalent classes of (R some C)"
possible (with R being a property and C a concept)? Also, are there any
limitations or additions to the "standard" profiles?

Thank you for the very good work with OWLIM, I'm appreciating it more
and more!

Nicola
___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion






___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion



___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] TBox queries

2012-07-12 Thread Barry Bishop

Hi Nicola,

Thanks for your question. I am very happy that you are still interested! 
Firstly, a little information about the supported rule-sets (and 
limitations) is here:


http://owlim.ontotext.com/display/OWLIMv51/OWLIM-SE+Reasoner#OWLIM-SEReasoner-PredefinedRuleSets

OWL2-QL is not really designed for rule-based reasoning engines, but 
OWL2-RL fits very well on OWLIM. We miss only datatype reasoning.


You can ask all sorts of queries, however, they must be in SPARQL form, 
so as long as you can write your expressions in RDF/Turtle syntax then 
you can probably ask it.


In the RDF serialisation of OWL, most things become restrictions, so 
your query will probably need to involve looking for restrictions on 
properties with some cardinality constraint. Sadly, I'm not an OWL 
expert, but maybe someone else could help with this kind of query?


Good luck,
barry

Barry Bishop
OWLIM Product Manager
Ontotext AD
Tel: +43 650 2000 237
email: barry.bis...@ontotext.com
skype: bazbishop
www.ontotext.com

On 12/07/12 09:56, Nicola Vitucci wrote:

Hi all,

I have another question for you :-)

Considering that OWLIM supports the OWL2 QL and RL profiles, what kinds
of TBox queries can be performed? Are queries with anonymous classes
like "find the subclasses/superclasses/equivalent classes of (R some C)"
possible (with R being a property and C a concept)? Also, are there any
limitations or additions to the "standard" profiles?

Thank you for the very good work with OWLIM, I'm appreciating it more
and more!

Nicola
___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion



___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] TBox queries

2012-07-12 Thread damyan

Hi Nicola,

yes, you could query for such - just express these as SPARQL queries

for instance,  a query against wordnet to get all the subclasses of a 
Restriction (wordn-sc:word some  wordn-sc:Word) may look like:


PREFIX wordn-sc: 
PREFIX rdfs: 
PREFIX owl: 

select * where {
?sub rdfs:subClassOf ?c .
?c a owl:Restriction;
owl:onProperty wordn-sc:word;
owl:someValuesFrom wordn-sc:Word .
}

About the supported inference and its limitations, best is to read 
"supported semantics" from the OWLIM Primer document 
 



HTH,
Damyan Ognyanov
Ontotext AD.


On 7/12/2012 10:56 AM, Nicola Vitucci wrote:

Hi all,

I have another question for you :-)

Considering that OWLIM supports the OWL2 QL and RL profiles, what kinds
of TBox queries can be performed? Are queries with anonymous classes
like "find the subclasses/superclasses/equivalent classes of (R some C)"
possible (with R being a property and C a concept)? Also, are there any
limitations or additions to the "standard" profiles?

Thank you for the very good work with OWLIM, I'm appreciating it more
and more!

Nicola
___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion




___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


[Owlim-discussion] Problem with enablePredicateList=true

2012-07-12 Thread Krzysztof Sielski

Hello,

I have a problem with repository (OWLIM SE 5.1.5208) with property 
enablePredicateList set to true. Documentation says that such 
configuration should speed up queries that use wildcard predicate 
patterns but our tests show the opposite. Please, see the attached test 
class - it creates a repository with little data and executes very 
simple query:


PREFIX foaf:
select * WHERE {
  foaf:knows ?person2 .
 ?person2 ?pred ?obj
}

Here are the results (with predicate list enabled and disabled):

Execute queries with predicate list enabled
Executing query q1
Result count: 2 in 2,555 s.
Execute queries with predicate list disabled
Executing query q1
Result count: 2 in 0,000 s.

--
Best regards,
Krzysztof Sielski
Poznan Supercomputing and Networking Center


import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.openrdf.model.Graph;
import org.openrdf.model.Resource;
import org.openrdf.model.URI;
import org.openrdf.model.impl.GraphImpl;
import org.openrdf.model.impl.LiteralImpl;
import org.openrdf.model.impl.StatementImpl;
import org.openrdf.model.impl.URIImpl;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.model.vocabulary.RDFS;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQueryResult;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.config.RepositoryConfig;
import org.openrdf.repository.config.RepositoryConfigException;
import org.openrdf.repository.config.RepositoryConfigSchema;
import org.openrdf.repository.manager.LocalRepositoryManager;
import org.openrdf.repository.manager.RepositoryManager;
import org.openrdf.repository.sail.config.SailRepositorySchema;
import org.openrdf.sail.config.SailConfigSchema;

/**
 *
 * @author Krzysztof Sielski
 */
public class OwlimTestCaseWildcardPredicate {

private static final String REPO_ID = "repo";
private static URI foaf_knows = new 
URIImpl("http://xmlns.com/foaf/0.1/knows";);
private static URI foaf_name = new 
URIImpl("http://xmlns.com/foaf/0.1/name";);
private static final String q1 = ""
+ "PREFIX foaf:"
+ "select * WHERE {"
+ "  foaf:knows ?person2 ."
+ " ?person2 ?pred ?obj"
+ "} ";

public static void main(String[] args)
throws Exception {
RepositoryManager manager = new LocalRepositoryManager(new 
File("."));
manager.initialize();
try {
initRepository(manager, true);
insertInitialData(manager);
System.out.println("Execute queries with predicate list 
enabled");
executeQueries(manager);
initRepository(manager, false);
System.out.println("Execute queries with predicate list 
disabled");
executeQueries(manager);
} finally {
manager.shutDown();
}
}

private static void executeQueries(RepositoryManager manager)
throws Exception {
Repository repo = manager.getRepository(REPO_ID);
repo.initialize();
RepositoryConnection con = repo.getConnection();
con.setAutoCommit(false);

System.out.println("Executing query q1");
executeQuery(q1, con);

con.close();
repo.shutDown();
}

private static void executeQuery(String query, RepositoryConnection 
con) {
try {
TupleQueryResult result = 
con.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate();
int resultCount = 0;
long time = System.currentTimeMillis();
while (result.hasNext()) {
result.next();
resultCount++;
}
time = System.currentTimeMillis() - time;
System.out.printf("Result count: %d in %.3f s.\n", 
resultCount, time / 1000.0);
} catch (Exception e) {
e.printStackTrace();
}
}

private static void insertInitialData(RepositoryManager manager)
throws Exception {
Repository repo = manager.getRepository(REPO_ID);
RepositoryConnection con = repo.getConnection();
con.setAutoCommit(false);

// add objects
final int peopleCount = 50;
for (int i = 0; i < peopleCount; i++) {
URI 

[Owlim-discussion] TBox queries

2012-07-12 Thread Nicola Vitucci
Hi all,

I have another question for you :-)

Considering that OWLIM supports the OWL2 QL and RL profiles, what kinds
of TBox queries can be performed? Are queries with anonymous classes
like "find the subclasses/superclasses/equivalent classes of (R some C)"
possible (with R being a property and C a concept)? Also, are there any
limitations or additions to the "standard" profiles?

Thank you for the very good work with OWLIM, I'm appreciating it more
and more!

Nicola
___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion