Resources with multiple rdf:type predicates [message #1619780] |
Mon, 16 February 2015 20:49  |
Eclipse User |
|
|
|
Hello,
I would like to use an OSLC4J annotation to define resources with multiple rdf:type predicates.
Currently, the OSLCNamespace and OSLCName annotations are used to define a single rdf:type predicate.
Line 308 in JenaModelHelper:
mainResource.addProperty(RDF.type, model.createResource(namespace + name));
I suggest creating a new annotation called "OSLCMultipleTypes" having two attributes named "namespaces" and "names" both of type String[] to store information related to additional rdf:type predicates. Do you think that this approach is reasonable? Do you suggest a better one?
If this approach is recommended, would you accept a code contribution to Eclipse Lyo to support it?
Best regards,
Axel
|
|
|
Re: Resources with multiple rdf:type predicates [message #1620893 is a reply to message #1619780] |
Tue, 17 February 2015 14:07   |
Eclipse User |
|
|
|
Hey, Axel. You should be able to specify additional types through an annotated getter. For instance,
@OslcDescription("The resource type URIs.")
@OslcName("type")
@OslcPropertyDefinition(OslcConstants.RDF_NAMESPACE + "type")
public URI[] getRdfTypes()
{
return rdfTypes;
}
One type is declared in the class annotation and the other can be declared using a static array or dynamically if you wish. Does this work for you?
We always welcome contributions if you think the declarative approach might be better.
Sam
|
|
|
|
Powered by
FUDForum. Page generated in 0.06280 seconds