2

I'm trying to work backwards from a Neo4j database to some equivalent OSLC AM resources. In this database, there are some nodes which have relationships to each other, and those relationships have attributes that don't belong to either of the nodes. In the OSLC translation, it's straightforward to create the nodes and properties, but I don't see any way to add properties to the properties. There is sample XML that shows how to do that with rdf:Description statements, but I'm not seeing now to obtain that output from OSLC4J objects. Reified resources only allow adding a single value, in situations where those can be used, and I need a minimum of seven. What am I missing?

Carl Burke
  • 71
  • 4
  • Reified properties can have as many values as needed. See https://www.w3.org/2007/02/turtle/primer/#L3155 for an example. Jad's reply will let you do this using Java. Try to stay away from relationship attributes / reification in general if you want to make it easy for consumers who expect document-like (JSON etc) responses. – berezovskyi Aug 06 '20 at 12:57

1 Answers1

2

If you are after reification, you can take inspiration from how the Link class (https://github.com/eclipse/lyo.core/blob/master/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/Link.java) is implemented in OSLC4J.

That is, create a class that extends AbstractReifiedResource, and define your 7 attributes on that class. Link has only a single String label attribute, but I believe you can define as many properties as possible.

jad
  • 116
  • 2
  • Thanks, I'll try this. Might need to modify the translation into RDF as well, but it's a place to start. – Carl Burke Aug 06 '20 at 12:39
  • FYI, OSLC/Lyo community iis at https://forum.open-services.net/ if you want more input from others as well. – jad Aug 11 '20 at 08:23