-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying a LocalResource with non-singleton Range gives wrong type #156
Comments
@berezovskyi I need your help recalling how to best deal with java class inheritance when it comes to JMH. Currently, a property with (a) LocalResource valueType, and (b) range pointing to multiple resources will result in a Java property whose type is "Link". I aimed to solve this by map the java property to an AbstractResource. New suggested approach: But 2 questions first:
|
@nilsjor Not because I want to avoid this problem, but I wonder if you should really consider using a real (not local) resource, yet define the OslcRepresentation to be "inline". Would you get what you want? |
@jadelkhoury which annotations are you planning to add to Please see https://github.com/eclipse/lyo.core/blob/master/oslc4j-jena-provider/src/test/java/org/eclipse/lyo/oslc4j/provider/jena/resources/Person.java#L29 for the kind of inheritance scenario that will be supported in Lyo 4.0. This is in line with the suggestion from @nilsjor to use the closest superclass for that field. If two range classes have nothing in common except for |
A suggestion: This is a perfect use-case for the visitor pattern. Generate a base, per-domain subclass of |
But how would we instantiate that class? We get RDF, then we need to call a ctor with reflection and only after we can call the visitor method. If we figure out the perfect class to instantiate, what's the purpose of the visitor pattern? Otherwise, how would one add their implementation if we instantiate some very general class like OslcRdfResource or something? |
I suppose this is a problem that's more applicable to the client @berezovskyi. I'll open another issue with this if I encounter it |
In particular, when the cardinality of the range is larger than one, the class attribute corresponding to the resource property becomes a Link.
The preferable behavior would be to type it as the nearest common superclass.
The text was updated successfully, but these errors were encountered: