}
// handle kam edges second
Iterator<KamEdge> kamEdges = kam.getEdges().iterator();
while (kamEdges.hasNext()) {
KamEdge kamEdge = kamEdges.next();
Resource relationshipResource =
KAMVocabulary.resourceForRelationship(kamEdge
.getRelationshipType());
Resource kamEdgeResource =
model.createResource(new AnonId(UUID.randomUUID()
.toString()));
// associate kam edge with kam resource
kamResource.addProperty(composedOf, kamEdgeResource);
// edge type KAMEdge
kamEdgeResource.addProperty(RDF.type, KAMEdge);
// edge hasRelationship Relationship
kamEdgeResource.addProperty(hasRelationship, relationshipResource);
// edge hasId "1"^^xsd:int
kamEdgeResource.addLiteral(hasId,
model.createTypedLiteral(kamEdge.getId()));
Resource sourceResource =
kamNodeResources.get(kamEdge.getSourceNode());
Resource targetResource =
kamNodeResources.get(kamEdge.getTargetNode());
// TODO: This is a sanity check that should be removed
if (null == sourceResource || null == targetResource) {
System.err
.println("Can't locate source or target node resource for edge: "
+ kamEdge.toString());
continue;
}
// edge hasSubjectNode KAMNode
kamEdgeResource.addProperty(hasSubjectNode, sourceResource);