History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: ELMO-48
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Peter Mika
Reporter: Shane Isbell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Elmo

Codegen: java#boolean is Unknown Datatype

Created: 19/Mar/08 12:02 AM   Updated: 19/Mar/08 02:46 AM
Component/s: Code Generator
Affects Version/s: 1.0
Fix Version/s: 1.0


 Description   
This problem is on trunk. I generated an owl file with the codegen. The owl file includes a java#boolean property value:

<owl:ObjectProperty rdf:about="http://www.apache.org/model#enabled">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
<rdfs:range rdf:resource="java:#boolean"/>
<rdfs:domain rdf:resource="http://www.apache.org/model#RepositoryPolicy"/>
<rdfs:label>enabled</rdfs:label>
<rdfs:isDefinedBy rdf:resource="http://www.apache.org/model#"/>
</owl:ObjectProperty>

When I attempt to use codegen to generate the concepts from the above owl file, the build fails:

org.openrdf.elmo.exceptions.ElmoConversionException: Unknown datatype: java:#boolean
        at org.openrdf.elmo.sesame.SesameLiteralManager.getClass(SesameLiteralManager.java:153)


 All   Comments   Change History      Sort Order:
Comment by James Leigh [19/Mar/08 12:10 AM]
Try using "java:java.lang.Boolean" or "http://www.w3.org/2001/XMLSchema#boolean"

elmo-codegen-1.0-beta2 does not support primitives. However, the snapshot version uses them if the cardinality of the property is one.

Comment by Shane Isbell [19/Mar/08 12:18 AM]
Replacing java:#boolean with http://www.w3.org/2001/XMLSchema#boolean worked perfectly. Now have a problem with

org.openrdf.elmo.exceptions.ElmoConversionException: Unknown datatype: java:java.lang#Class

Comment by James Leigh [19/Mar/08 12:26 AM]
Many Java classes can be used as literals by using "java:" + full class name for the datatype. So in this case you could use "java:java.lang.Class".

Comment by Shane Isbell [19/Mar/08 12:35 AM]
Thanks for the quick and helpful response: it now works. This would be a bug in the codegen for owl generation, where boolean should generate as http://www.w3.org/2001/XMLSchema#boolean and all java datatypes to use "java:" + full class name.

Comment by James Leigh [19/Mar/08 02:46 AM]
revision 6376