Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lyo-dev] Fwd: Dynamic Model

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

I'm currently working on a piece of code that needs to dynamically build
resources (e.g. requirements) during runtime. That is, during compile
time I do not have the knowledge of what resources there are and how
they are typed. Thus I do not have the possibility to create java
classes with the appropriate annotations (except through runtime
generation, which I want to avoid).

Now, is there any possibility to make use of (parts of) the lyo
libraries without resource classes that are annotated? Is it conceivable
to extend the library in a few spots to allow working on (dynamic)
resources, which are not based on annotated pojos (and if so could you
point them out?), or is this concept of retrieving and using annotations
spread too widely within the library to actually support that use case?

I got at least some small example working implementing IExtendedResource
using the extended properties, but that does not go very far (writing
rdf with jena did work to some extent, but reading that rdf did not work
because of missing annotations on the target class).

Kind regards and thanks in advance
Gunther Bachmann


PS: To give an impression of what I want to do, some non working java
code that defines e.g. a requirement with properties which are unknown
on compile time and are dynamically constructed during runtime ...

class MyResource{
  URI uri; // resource identification
}
class Requirement extends MyResource{
  List<Property> properties // list is filled during runtime
}
class Property{
  QName qname; // names are set during runtime
}
class StringProperty extends Property{
  String value;
}
class RelationProperty extends Property{ // e.g. rdf:type
  MyResource target;
  List<Property> values; // relations may have describing values
themselves (reification)
}


-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCgAGBQJSgj8EAAoJELelx/gErhtqBlYIAIWD2xx7G1YdK+E3RyiLDH6N
pApbnXOtxEckGFTWUtzeLaZIFbfMv6F5+b38Lco/waD1+BRkyrgCJWS/TgtBbn2I
hZvrQQIs/XUQ9cazX+z8akpoUAM3WtmbXMskOco7/fp/2k5EL9i/GMIl4WAy1OkY
wwlxgW9wH/z9+x2dJ3H8Ec3uHgZG8rAnRDEglqPs1xnzYG3oKou7Am4lYUWs/K/Z
loBs0jpCQskLQ+4Q9PPK2JH4nfNK0Njmj1AlTswKHcwJCZPk9b7FJ7viXEW+3xgw
co6zIXsjM5O7WQ7rDqSjcpurkyjX+QGxauQx9HEyI8hg2EbzV6G95SIBQ50Bf+8=
=+ugP
-----END PGP SIGNATURE-----


Back to the top