Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » Resources with multiple rdf:type predicates (New OSLC4J Annotation to define additional rdf:type predicates )
Resources with multiple rdf:type predicates [message #1619780] Mon, 16 February 2015 20:49 Go to next message
Axel Reichwein is currently offline Axel ReichweinFriend
Messages: 5
Registered: February 2015
Junior Member
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 Go to previous messageGo to next message
Samuel Padgett is currently offline Samuel PadgettFriend
Messages: 30
Registered: July 2009
Member
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
Re: Resources with multiple rdf:type predicates [message #1621200 is a reply to message #1620893] Tue, 17 February 2015 18:54 Go to previous message
Axel Reichwein is currently offline Axel ReichweinFriend
Messages: 5
Registered: February 2015
Junior Member
Thanks Sam! Your proposal is cleaner and doesn't require any change to the JenaModelHelper class. I will adopt it.

Best regards,
Axel

Previous Topic:Problem accessing /OSLC4JStockQuote/stockQuotes
Next Topic:Problem accessing /OSLC4JQualityManagement/services/testPlans. Reason: Not Found
Goto Forum:
  


Current Time: Sun Sep 23 18:13:27 GMT 2018

Powered by FUDForum. Page generated in 0.02174 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top