Hi Michael,
On 07/05/13 20:30, Michael Trosin wrote:
Hi,
I am quite new to mailing-lists, so sorry if this is not the way, how I
should start a "topic".
This is fine. Welcome to jena-users!
I have the attached ontology and I'm trying to list declared properties
of the class "Dataset" via:
OntClass ontclass = mOntModel.getOntClass(namespace + "#Dataset");
ExtendedIterator<OntProperty> ei = ontclass.listDeclaredProperties();
Doing it this way I get much properties, which actually aren't
properties from dataset (hasDataAnalysis, hasPublishing, ...). Loading
it with direct = true gives me the correct properties. So far so good,
the problem is, that I get now wrong results when using:
OntClass ontclass = mOntModel.getOntClass(namespace + "#LifecycleResource");
ExtendedIterator<OntProperty> ei = ontclass.listDeclaredProperties(true);
Now the only property is "hasKey" (missing hasName, hasTimestamp, ...).
Is the ontology wrong defined? Or do I miss anything else?
It's very difficult to give any advice with this minimal amount of
information. You ask if your ontology is not correct, but you don't tell
us what the ontology contains ..
Please provide a complete, minimal example. What this means: the
smallest amount of code and an extract from your ontology that shows the
problem, in a way that we can run your code to see exactly what is
happening. Please don't just try to post your entire project.
By the way, what listDeclaredProperties() does is documented here:
http://jena.apache.org/documentation/notes/rdf-frames.html
You might find it useful background reading.
I fixed one class and the other is no broken. I have no idea, what the
issue could be.
For any ideas many thanks in advice.
Best regards,
Michael
Ian