Skip to content

Commit

Permalink
Ingestion Nodegroups : use better identifier column names when the ob…
Browse files Browse the repository at this point in the history
…ject of a complex range

      aka RACK SecurityEntity  content_identifier_2 should be content_Port_identifier
  • Loading branch information
Paul Cuddihy committed May 25, 2022
1 parent df0c7a1 commit 335289f
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void build() throws Exception {

for (String rangeUri : nItem.getRangeUris()) {
// Add object property node to nodegroup (optional) and importSpec
String rangeKeyname = new OntologyName(rangeUri).getLocalName();
Node objNode = nodegroup.addNode(rangeUri, node, null, nItem.getUriConnectBy());
nItem.setOptionalMinus(objNode, NodeItem.OPTIONAL_TRUE);

Expand All @@ -148,7 +149,7 @@ public void build() throws Exception {
// }

// give it a name, e.g.: verifies_ENTITY
String objNodeName = nItem.getKeyName() + "_" + new OntologyName(rangeUri).getLocalName();
String objNodeName = nItem.getKeyName() + "_" + rangeKeyname;
nodegroup.setBinding(objNode, objNodeName);

// set data property matching ID_REGEX returned
Expand All @@ -158,8 +159,17 @@ public void build() throws Exception {
// but not optional (link to node is optional instead)
nodegroup.setIsReturned(pItem, true);

// give it a meaningful name
String propId = nodegroup.changeSparqlID(pItem, nItem.getKeyName() + "_" + pItem.getKeyName());
// give ID_REGEX property a meaningful sparqlID
String sparqlID;
if (nItem.getRangeUris().size() > 1) {
// complex range: include the class
sparqlID = nItem.getKeyName() + "_" + rangeKeyname + "_" + pItem.getKeyName();

} else {
// 'default'
sparqlID = nItem.getKeyName() + "_" + pItem.getKeyName();
}
String propId = nodegroup.changeSparqlID(pItem, sparqlID);



Expand Down

0 comments on commit 335289f

Please sign in to comment.