Search in sources :

Example 11 with EntityGraph

use of org.codice.alliance.nsili.common.UCO.EntityGraph in project alliance by codice.

the class NsiliDataModel method getAttributesForView.

public List<AttributeInformation> getAttributesForView(String viewName) {
    List<AttributeInformation> attributeInformation = new ArrayList<>();
    EntityGraph graph = getEntityGraph(viewName);
    for (EntityNode node : graph.nodes) {
        List<AttributeInformation> nodeAttrs = getAttributeInformation(node.entity_name);
        if (nodeAttrs != null) {
            attributeInformation.addAll(nodeAttrs);
        }
    }
    return attributeInformation;
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) EntityGraph(org.codice.alliance.nsili.common.UCO.EntityGraph) ArrayList(java.util.ArrayList) EntityNode(org.codice.alliance.nsili.common.UCO.EntityNode)

Example 12 with EntityGraph

use of org.codice.alliance.nsili.common.UCO.EntityGraph in project alliance by codice.

the class NsiliDataModel method initTdlViewGraph.

private void initTdlViewGraph() {
    EntityRelationship productPartRln = new EntityRelationship(productNode.id, partNode.id, Cardinality.ONE_TO_ONE, Cardinality.ONE_TO_ONE);
    EntityNode[] viewNodes = new EntityNode[] { productNode, approvalNode, cardNode, fileNode, streamNode, metadataSecurityNode, relatedFileNode, securityNode, partNode, commonNode, coverageNode, exploitationNode, tdlNode, associationNode, relationNode, sourceNode, destinationNode };
    EntityRelationship[] viewRelationships = new EntityRelationship[] { productApprovalRln, productCardRln, productFileRln, productStreamRln, productMetadataSecurityRln, productRelatedFileRln, productSecurityRln, productPartRln, partSecurityRln, partCommonRln, partCoverageRln, partExploitationRln, partTdlRln, productAssociationRln, assocCardRln, assocRelationRln, assocSourceRln, assocDestRln };
    viewGraphMap.put(NsiliConstants.NSIL_TDL_VIEW, new EntityGraph(viewNodes, viewRelationships));
    List<Pair<ConceptualAttributeType, String>> conceptualPairs = new ArrayList<>();
    conceptualPairs.add(classificationPair);
    conceptualPairs.add(dataSetTypePair);
    conceptualPairs.add(dataSizePair);
    conceptualPairs.add(directAccessPair);
    conceptualPairs.add(footprintPair);
    conceptualPairs.add(modificationDatePair);
    conceptualPairs.add(productTitlePair);
    conceptualPairs.add(uniqueIdPair);
    conceptualAttrMap.put(NsiliConstants.NSIL_TDL_VIEW, conceptualPairs);
    updateMandatoryAttrs(NsiliConstants.NSIL_TDL_VIEW, viewNodes);
}
Also used : EntityGraph(org.codice.alliance.nsili.common.UCO.EntityGraph) EntityRelationship(org.codice.alliance.nsili.common.UCO.EntityRelationship) ArrayList(java.util.ArrayList) EntityNode(org.codice.alliance.nsili.common.UCO.EntityNode) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) Pair(org.apache.commons.lang3.tuple.Pair)

Aggregations

EntityGraph (org.codice.alliance.nsili.common.UCO.EntityGraph)12 ArrayList (java.util.ArrayList)11 EntityNode (org.codice.alliance.nsili.common.UCO.EntityNode)11 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)10 Pair (org.apache.commons.lang3.tuple.Pair)10 EntityRelationship (org.codice.alliance.nsili.common.UCO.EntityRelationship)10 AttributeInformation (org.codice.alliance.nsili.common.GIAS.AttributeInformation)1 Test (org.junit.Test)1