Re: How to implement the enumerated restriction?

2016-10-15 Thread Darko Androcec
I am looking at the 
https://www.w3.org/TR/owl2-mapping-to-rdf/#Mapping_from_the_Structural_Specification_to_RDF_Graphs, 
but I still didn't find a solution how to create the needed format, so I 
will be grateful if someone has some idea how to do it?


Darko


On 16.10.2016. 0:10, Darko Androcec wrote:
Yes, I am aware that it is the OWL2 and that is not supported in Jena, 
but is there any workaround to get the format I need? How can I 
manually insert enumeration into restriction?


Thanks,
Darko

On 15.10.2016. 23:36, Martynas Jusevičius wrote:

Looks like OWL 2 which Jena does not support.

On Sat, Oct 15, 2016 at 11:32 PM, Darko Androcec
 wrote:
My aim is to get the following enumerated restriction using Apache 
Jena:


  
 http://www.equixonline.com/Grainger#TestClass"/>

 

 http://www.equixonline.com/Grainger#TestObjectProperty"/>

 
 http://www.equixonline.com/Grainger#male"/>
 http://www.equixonline.com/Grainger#female"/>
 

 



I tried different codes, but can't get the above restriction. If I 
use the

following code:

OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI +
"TestObjectProperty");
MaxCardinalityRestriction restriction =
model.createMaxCardinalityRestriction(null, objectProperty, 1);

newItemClass.addSuperClass(restriction);

I get max cardinality restriction without enumeration:

  
 http://www.equixonline.com/Grainger#TestClass"/>
 
 http://www.equixonline.com/Grainger#TestObjectProperty"/>
 
 

When I add the following code:

Individual male = model.createIndividual(baseURI + "male", OWL.Thing);
Individual female = model.createIndividual(baseURI + "female", 
OWL.Thing);

RDFList enums = model.createList();
enums = enums.cons(male);
enums = enums.cons(female);

OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI +
"TestObjectProperty");
MaxCardinalityRestriction restriction =
model.createMaxCardinalityRestriction(null, objectProperty, 1);

restriction.addProperty(OWL.oneOf, enums);

newItemClass.addSuperClass(restriction);

I only get enumeration, but max cardinality restriction is nowhere 
to find:



 http://www.equixonline.com/Grainger#TestClass"/>
 
 http://www.equixonline.com/Grainger#male"/>
 http://www.equixonline.com/Grainger#female"/>
 


Do you maybe know what I am doing wrong and how to get format 
(enumerated

restriction) described at the beginning of this message?

Thanks,

Darko







Re: How to implement the enumerated restriction?

2016-10-15 Thread Darko Androcec
Yes, I am aware that it is the OWL2 and that is not supported in Jena, 
but is there any workaround to get the format I need? How can I manually 
insert enumeration into restriction?


Thanks,
Darko

On 15.10.2016. 23:36, Martynas Jusevičius wrote:

Looks like OWL 2 which Jena does not support.

On Sat, Oct 15, 2016 at 11:32 PM, Darko Androcec
 wrote:

My aim is to get the following enumerated restriction using Apache Jena:

  
 http://www.equixonline.com/Grainger#TestClass"/>

 

 http://www.equixonline.com/Grainger#TestObjectProperty"/>

 
 http://www.equixonline.com/Grainger#male"/>
 http://www.equixonline.com/Grainger#female"/>
 

 



I tried different codes, but can't get the above restriction. If I use the
following code:

OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI +
"TestObjectProperty");
MaxCardinalityRestriction restriction =
model.createMaxCardinalityRestriction(null, objectProperty, 1);

newItemClass.addSuperClass(restriction);

I get max cardinality restriction without enumeration:

  
 http://www.equixonline.com/Grainger#TestClass"/>
 
 http://www.equixonline.com/Grainger#TestObjectProperty"/>
 
 

When I add the following code:

Individual male = model.createIndividual(baseURI + "male", OWL.Thing);
Individual female = model.createIndividual(baseURI + "female", OWL.Thing);
RDFList enums = model.createList();
enums = enums.cons(male);
enums = enums.cons(female);

OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI +
"TestObjectProperty");
MaxCardinalityRestriction restriction =
model.createMaxCardinalityRestriction(null, objectProperty, 1);

restriction.addProperty(OWL.oneOf, enums);

newItemClass.addSuperClass(restriction);

I only get enumeration, but max cardinality restriction is nowhere to find:


 http://www.equixonline.com/Grainger#TestClass"/>
 
 http://www.equixonline.com/Grainger#male"/>
 http://www.equixonline.com/Grainger#female"/>
 


Do you maybe know what I am doing wrong and how to get format (enumerated
restriction) described at the beginning of this message?

Thanks,

Darko





Re: How to implement the enumerated restriction?

2016-10-15 Thread Martynas Jusevičius
Looks like OWL 2 which Jena does not support.

On Sat, Oct 15, 2016 at 11:32 PM, Darko Androcec
 wrote:
> My aim is to get the following enumerated restriction using Apache Jena:
>
>  
> http://www.equixonline.com/Grainger#TestClass"/>
>
> 
>
>  IRI="http://www.equixonline.com/Grainger#TestObjectProperty"/>
>
> 
>  IRI="http://www.equixonline.com/Grainger#male"/>
>  IRI="http://www.equixonline.com/Grainger#female"/>
> 
>
> 
>
> 
>
> I tried different codes, but can't get the above restriction. If I use the
> following code:
>
> OntClass newItemClass = model.createClass(baseURI + "TestClass");
> ObjectProperty objectProperty = model.createObjectProperty(baseURI +
> "TestObjectProperty");
> MaxCardinalityRestriction restriction =
> model.createMaxCardinalityRestriction(null, objectProperty, 1);
>
> newItemClass.addSuperClass(restriction);
>
> I get max cardinality restriction without enumeration:
>
>  
> http://www.equixonline.com/Grainger#TestClass"/>
> 
>  IRI="http://www.equixonline.com/Grainger#TestObjectProperty"/>
> 
> 
>
> When I add the following code:
>
> Individual male = model.createIndividual(baseURI + "male", OWL.Thing);
> Individual female = model.createIndividual(baseURI + "female", OWL.Thing);
> RDFList enums = model.createList();
> enums = enums.cons(male);
> enums = enums.cons(female);
>
> OntClass newItemClass = model.createClass(baseURI + "TestClass");
> ObjectProperty objectProperty = model.createObjectProperty(baseURI +
> "TestObjectProperty");
> MaxCardinalityRestriction restriction =
> model.createMaxCardinalityRestriction(null, objectProperty, 1);
>
> restriction.addProperty(OWL.oneOf, enums);
>
> newItemClass.addSuperClass(restriction);
>
> I only get enumeration, but max cardinality restriction is nowhere to find:
>
> 
> http://www.equixonline.com/Grainger#TestClass"/>
> 
>  IRI="http://www.equixonline.com/Grainger#male"/>
>  IRI="http://www.equixonline.com/Grainger#female"/>
> 
> 
>
> Do you maybe know what I am doing wrong and how to get format (enumerated
> restriction) described at the beginning of this message?
>
> Thanks,
>
> Darko
>


How to implement the enumerated restriction?

2016-10-15 Thread Darko Androcec

My aim is to get the following enumerated restriction using Apache Jena:

 
http://www.equixonline.com/Grainger#TestClass"/>



IRI="http://www.equixonline.com/Grainger#TestObjectProperty"/>



IRI="http://www.equixonline.com/Grainger#male"/>
IRI="http://www.equixonline.com/Grainger#female"/>







I tried different codes, but can't get the above restriction. If I use 
the following code:


OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI + 
"TestObjectProperty");
MaxCardinalityRestriction restriction = 
model.createMaxCardinalityRestriction(null, objectProperty, 1);


newItemClass.addSuperClass(restriction);

I get max cardinality restriction without enumeration:

 
http://www.equixonline.com/Grainger#TestClass"/>

IRI="http://www.equixonline.com/Grainger#TestObjectProperty"/>




When I add the following code:

Individual male = model.createIndividual(baseURI + "male", OWL.Thing);
Individual female = model.createIndividual(baseURI + "female", OWL.Thing);
RDFList enums = model.createList();
enums = enums.cons(male);
enums = enums.cons(female);

OntClass newItemClass = model.createClass(baseURI + "TestClass");
ObjectProperty objectProperty = model.createObjectProperty(baseURI + 
"TestObjectProperty");
MaxCardinalityRestriction restriction = 
model.createMaxCardinalityRestriction(null, objectProperty, 1);


restriction.addProperty(OWL.oneOf, enums);

newItemClass.addSuperClass(restriction);

I only get enumeration, but max cardinality restriction is nowhere to find:


http://www.equixonline.com/Grainger#TestClass"/>

IRI="http://www.equixonline.com/Grainger#male"/>
IRI="http://www.equixonline.com/Grainger#female"/>




Do you maybe know what I am doing wrong and how to get format 
(enumerated restriction) described at the beginning of this message?


Thanks,

Darko



Re: Unsubscribe from mail list.

2016-10-15 Thread Andy Seaborne

You can unsubscribe by sending email to

users-unsubscr...@jena.apache.org

http://jena.apache.org/help_and_support/index.html

Andy

On 15/10/16 19:34, Paulo Picota wrote:

Hello friends i will like to be remove from this mail list



Unsubscribe from mail list.

2016-10-15 Thread Paulo Picota
Hello friends i will like to be remove from this mail list


Re: Selectbuilder

2016-10-15 Thread Claude Warren
On futher investigation there is a bug where by the defined prefixes are
not passed to the select query when the expression is parsed from the
string.  I will open the bug and submit a fix shortly.

Claude

On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler  wrote:

> I'm having an issue with Selectbuilder which may be an issue with the
> parser itself, or perhaps I've just made a mistake. I am setting a variable
> in a select as follows:
>
> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>
>
> which is throwing this exception:
>
> Exception in thread "main" org.apache.jena.query.QueryParseException:
>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>> at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>> arserBase.java:521)
>> at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>> se.java:286)
>>
> ..
>
> The prefix map contains the following:
>
> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>
>
> So, the xsd prefix is defined, but the error seems to think that
> xsd:integer is all a prefix?
>
> Any thoughts on this problem? Is my addVar call correct?
>
> Thanks,
> Todd Detwiler
>
> --
> Landon Todd Detwiler
> Structural Informatics Group (SIG)
> University of Washington
>
> phone: 206-351-7721
>
>


-- 
I like: Like Like - The likeliest place on the web

LinkedIn: http://www.linkedin.com/in/claudewarren


Re: Selectbuilder

2016-10-15 Thread Claude Warren
Todd,

The QueryBuilder

addVar("SUM(xsd:integer(?V3))", "?V3SUM")

statement ends up executing

select SUM(xsd:integer(?V3))

in order to build the equivalent Expr.  It is the "select
SUM(xsd:integer(?V3))" that is causing the exception.

I don't have a deep enough background in SPARQL query intricacies to tell
you how to do it but I suspect that xsd:integer(?V3) is not the way to cast
?V3 to an integer during a SUM call.  Perhaps there are others here that
can help?

Claude




On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler  wrote:

> I'm having an issue with Selectbuilder which may be an issue with the
> parser itself, or perhaps I've just made a mistake. I am setting a variable
> in a select as follows:
>
> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>
>
> which is throwing this exception:
>
> Exception in thread "main" org.apache.jena.query.QueryParseException:
>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>> at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>> arserBase.java:521)
>> at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>> se.java:286)
>>
> ..
>
> The prefix map contains the following:
>
> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>
>
> So, the xsd prefix is defined, but the error seems to think that
> xsd:integer is all a prefix?
>
> Any thoughts on this problem? Is my addVar call correct?
>
> Thanks,
> Todd Detwiler
>
> --
> Landon Todd Detwiler
> Structural Informatics Group (SIG)
> University of Washington
>
> phone: 206-351-7721
>
>


-- 
I like: Like Like - The likeliest place on the web

LinkedIn: http://www.linkedin.com/in/claudewarren