Jena and DAML question

  I have a question about Jena and DAML

  I have the following xmlschema

--- c:\users\mcarrion\javaprogs\damltest\rdf\ownTypes.xsd  
---------------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/10/XMLSchema">
<xsd:simpleType name="joven">
	<xsd:restriction
base="http://www.w3.org/2001/10/XMLSchema#positiveInteger">
		<xsd:maxInclusive value="14"/> 
	</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
--- eof -------------------------------------

ok?
  I also have this daml model

--- c:\users\mcarrion\javaprogs\damltest\rdf\daml.rdf 
--------------------------

<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
	xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
	xmlns:xsd="http://www.w3.org/2001/10/XMLSchema#"
	xmlns:xsdOwn="file:///users/mcarrion/javaprogs/damltest/rdf/ownTypes#"
	xmlns:own="file:///users/mcarrion/javaprogs/damltest/rdf/ownTypes#"
	xmlns="file:///users/mcarrion/javaprogs/damltest/rdf/daml#"
	>

<daml:Ontology rdf:about="">
	<rdfs:comment>Example</rdfs:comment>
	<daml:imports rdf:resource="http://www.daml.org/2001/03/daml+oil"/>
</daml:Ontology>

<daml:Class rdf:ID="Persona"/>

<Persona rdf:ID="p1">
	<name>Jose Manuel</name>
	<age>20</age>
</Persona>

<Persona rdf:ID="p2">
	<name>Marc</name>
	<age>10</age>
</Persona>

<daml:DatatypeProperty rdf:ID="age">
	<rdfs:domain rdf:resource="#Persona"/>
	<rdfs:range
rdf:resource="http://www.w3.org/2001/10/XMLSchema#positiveInteger"/>
</daml:DatatypeProperty>

<daml:DatatypeProperty rdf:ID="name">
	<rdfs:domain rdf:resource="#Persona"/>
	<rdfs:range rdf:resource="http://www.w3.org/2001/10/XMLSchema#String"/>
</daml:DatatypeProperty>

<daml:Class rdf:about="#Joven">
	<daml:intersectionOf rdf:parseType="daml:collection">
		<rdfs:Class rdf:about="#Persona"/>
		<daml:Restriction>
				<daml:onProperty rdf:resource="#age"/>
				<daml:hasClass
rdf:resource="file:///users/mcarrion/javaprogs/damltest/rdf/ownTypes#joven"/>
		</daml:Restriction>
	</daml:intersectionOf>
</daml:Class>

</rdf:RDF>

--- eof -----------------------------------------------


  Here I have the Person class and I want to define the Joven class (Young
in spanish) this is the way I found in the examples.
  
  When running jena I have the DAMLClass Joven (j)
  if I do j.getInstances() the iterator that I get is empty, why? should
this call returns me the instance p2 or not? Am I doing something wrong? or
maybe I thought that the call should return somenthing that it shouldn't...
I don't know
  
  Thanks everybody for you help,
                                Marc

Received on Thursday, 7 February 2002 06:25:11 UTC