String edgeId = pageVertex.getId() + "_" + label + "_" + linkedPageVertex.getId();
addEdge(edgeId, pageVertex, linkedPageVertex, label, visibility, authorizations);
}
private Vertex createDbpediaEntityVertex(LineData lineData) {
Vertex pageVertex = createPageVertex(lineData);
String dbpediaEntityVertexId = getDbpediaEntityVertexId(lineData.getPageTitle());
VertexBuilder entityVertexBuilder = prepareVertex(dbpediaEntityVertexId, visibility);
Map<String, Object> conceptTypeMetadata = new HashMap<String, Object>();
LumifyProperties.CONFIDENCE.setMetadata(conceptTypeMetadata, 0.1);
LumifyProperties.CONCEPT_TYPE.addPropertyValue(entityVertexBuilder, ImportMR.MULTI_VALUE_KEY, "http://www.w3.org/2002/07/owl#Thing", conceptTypeMetadata, visibility);
Map<String, Object> titleMetadata = new HashMap<String, Object>();
LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, 0.1);
LumifyProperties.TITLE.addPropertyValue(entityVertexBuilder, ImportMR.MULTI_VALUE_KEY, lineData.getPageTitle(), titleMetadata, visibility);
if (lineData.getPropertyIri().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") && lineData.getValue() instanceof LinkValue) {
LinkValue linkValue = (LinkValue) lineData.getValue();
Integer ontologyDepth = getConceptDepth(linkValue.getValueString());
if (ontologyDepth != null) {
conceptTypeMetadata = new HashMap<String, Object>();
LumifyProperties.CONFIDENCE.setMetadata(conceptTypeMetadata, 0.2 + ((double) ontologyDepth / 1000.0));
String multiValueKey = ImportMR.MULTI_VALUE_KEY + "#" + linkValue.getValueString();
LumifyProperties.CONCEPT_TYPE.addPropertyValue(entityVertexBuilder, multiValueKey, linkValue.getValueString(), conceptTypeMetadata, visibility);
}
}
if (!(lineData.getValue() instanceof LinkValue)) {
String multiValueKey = lineData.getValue().getValueString();
entityVertexBuilder.addPropertyValue(multiValueKey, lineData.getPropertyIri(), lineData.getValue().getValue(), visibility);
}
Vertex entityVertex = entityVertexBuilder.save(authorizations);
String edgeId = getEntityHasWikipediaPageEdgeId(entityVertex, pageVertex);
addEdge(edgeId, entityVertex, pageVertex, DbpediaOntology.EDGE_LABEL_ENTITY_HAS_WIKIPEDIA_PAGE, visibility, authorizations);
return entityVertex;