@Test public void testExtractWithNotHtml() throws Exception { String data = "<title>Test Title</title>"; data += "<meta content=\"2013-01-01T18:09:20Z\" itemprop=\"datePublished\" name=\"pubdate\"/>"; data += "<h1>Five reasons why Windows 8 has failed</h1>"; data += "<p>The numbers speak for themselves. Vista, universally acknowledged as a failure, actually had significantly better adoption numbers than Windows 8. At similar points in their roll-outs, Vista had a desktop market share of 4.52% compared to Windows 8's share of 2.67%. Underlining just how poorly Windows 8's adoption has gone, Vista didn't even have the advantage of holiday season sales to boost its numbers. Tablets--and not Surface RT tablets--were what people bought last December, not Windows 8 PCs.</p>"; data += "</body>"; data += "</html>"; createVertex(data, "text/html"); InputStream in = new ByteArrayInputStream(data.getBytes()); Vertex vertex = graph.getVertex("v1", authorizations); Property property = vertex.getProperty(LumifyProperties.RAW.getPropertyName()); GraphPropertyWorkData workData = new GraphPropertyWorkData(visibilityTranslator, vertex, property, null, null); textExtractor.execute(in, workData); vertex = graph.getVertex("v1", authorizations); assertEquals("Test Title", LumifyProperties.TITLE.getPropertyValue(vertex)); assertEquals( "Five reasons why Windows 8 has failed\n" + "The numbers speak for themselves. Vista, universally acknowledged as a failure, actually had significantly better adoption numbers than Windows 8. At similar points in their roll-outs, Vista had a desktop market share of 4.52% compared to Windows 8's share of 2.67%. Underlining just how poorly Windows 8's adoption has gone, Vista didn't even have the advantage of holiday season sales to boost its numbers. Tablets--and not Surface RT tablets--were what people bought last December, not Windows 8 PCs.\n", IOUtils.toString(LumifyProperties.TEXT.getPropertyValue(vertex).getInputStream(), "UTF-8") ); assertEquals(new Date(1357063760000L), LumifyProperties.CREATE_DATE.getPropertyValue(vertex)); }
@Override public void execute(InputStream in, GraphPropertyWorkData data) throws Exception { String mimeType = (String) data.getProperty().getMetadata().getValue(LumifyProperties.MIME_TYPE.getPropertyName()); checkNotNull(mimeType, LumifyProperties.MIME_TYPE.getPropertyName() + " is a required metadata field"); Charset charset = Charset.forName("UTF-8"); Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, mimeType); String text = extractText(in, mimeType, metadata); ExistingElementMutation<Vertex> m = data.getElement().prepareMutation(); String author = extractTextField(metadata, authorKeys); if (author != null && author.length() > 0) { LumifyProperties.AUTHOR.addPropertyValue(m, MULTI_VALUE_KEY, author, data.createPropertyMetadata(), data.getVisibility()); } String customImageMetadata = extractTextField(metadata, customFlickrMetadataKeys); org.securegraph.Metadata textMetadata = data.createPropertyMetadata(); LumifyProperties.MIME_TYPE.setMetadata(textMetadata, "text/plain", getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.META_DATA_TEXT_DESCRIPTION.setMetadata(textMetadata, "Extracted Text", getVisibilityTranslator().getDefaultVisibility()); if (customImageMetadata != null && !customImageMetadata.equals("")) { try { JSONObject customImageMetadataJson = new JSONObject(customImageMetadata); text = new JSONObject(customImageMetadataJson.get("description").toString()).get("_content") + "\n" + customImageMetadataJson.get("tags").toString(); StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); Date lastupdate = GenericDateExtractor .extractSingleDate(customImageMetadataJson.get("lastupdate").toString()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, lastupdate, data.createPropertyMetadata(), data.getVisibility()); org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, customImageMetadataJson.get("title").toString(), titleMetadata, data.getVisibility()); } catch (JSONException e) { LOGGER.warn("Image returned invalid custom metadata"); } } else { StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, extractDate(metadata), data.createPropertyMetadata(), data.getVisibility()); String title = extractTextField(metadata, subjectKeys).trim(); if (title != null && title.length() > 0) { org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, title, titleMetadata, data.getVisibility()); } if (pageCountProperty != null) { String numberOfPages = extractTextField(metadata, numberOfPagesKeys); if (numberOfPages != null) { org.securegraph.Metadata numberOfPagesMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(numberOfPagesMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); pageCountProperty.addPropertyValue(m, MULTI_VALUE_KEY, Long.valueOf(numberOfPages), numberOfPagesMetadata, data.getVisibility()); } } } Vertex v = m.save(getAuthorizations()); getAuditRepository().auditVertexElementMutation(AuditAction.UPDATE, m, v, MULTI_VALUE_KEY, getUser(), data.getVisibility()); getAuditRepository().auditAnalyzedBy(AuditAction.ANALYZED_BY, v, getClass().getSimpleName(), getUser(), v.getVisibility()); getGraph().flush(); getWorkQueueRepository().pushGraphPropertyQueue(data.getElement(), MULTI_VALUE_KEY, LumifyProperties.TEXT.getPropertyName(), data.getWorkspaceId(), data.getVisibilitySource()); }
TikaTextExtractorGraphPropertyWorker extends GraphPropertyWorker { @Override public void execute(InputStream in, GraphPropertyWorkData data) throws Exception { String mimeType = (String) data.getProperty().getMetadata().getValue(LumifyProperties.MIME_TYPE.getPropertyName()); checkNotNull(mimeType, LumifyProperties.MIME_TYPE.getPropertyName() + " is a required metadata field"); Charset charset = Charset.forName("UTF-8"); Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, mimeType); String text = extractText(in, mimeType, metadata); ExistingElementMutation<Vertex> m = data.getElement().prepareMutation(); String author = extractTextField(metadata, authorKeys); if (author != null && author.length() > 0) { LumifyProperties.AUTHOR.addPropertyValue(m, MULTI_VALUE_KEY, author, data.createPropertyMetadata(), data.getVisibility()); } String customImageMetadata = extractTextField(metadata, customFlickrMetadataKeys); org.securegraph.Metadata textMetadata = data.createPropertyMetadata(); LumifyProperties.MIME_TYPE.setMetadata(textMetadata, "text/plain", getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.META_DATA_TEXT_DESCRIPTION.setMetadata(textMetadata, "Extracted Text", getVisibilityTranslator().getDefaultVisibility()); if (customImageMetadata != null && !customImageMetadata.equals("")) { try { JSONObject customImageMetadataJson = new JSONObject(customImageMetadata); text = new JSONObject(customImageMetadataJson.get("description").toString()).get("_content") + "\n" + customImageMetadataJson.get("tags").toString(); StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); Date lastupdate = GenericDateExtractor .extractSingleDate(customImageMetadataJson.get("lastupdate").toString()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, lastupdate, data.createPropertyMetadata(), data.getVisibility()); org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, customImageMetadataJson.get("title").toString(), titleMetadata, data.getVisibility()); } catch (JSONException e) { LOGGER.warn("Image returned invalid custom metadata"); } } else { StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, extractDate(metadata), data.createPropertyMetadata(), data.getVisibility()); String title = extractTextField(metadata, subjectKeys).trim(); if (title != null && title.length() > 0) { org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, title, titleMetadata, data.getVisibility()); } if (pageCountProperty != null) { String numberOfPages = extractTextField(metadata, numberOfPagesKeys); if (numberOfPages != null) { org.securegraph.Metadata numberOfPagesMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(numberOfPagesMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); pageCountProperty.addPropertyValue(m, MULTI_VALUE_KEY, Long.valueOf(numberOfPages), numberOfPagesMetadata, data.getVisibility()); } } } Vertex v = m.save(getAuthorizations()); getAuditRepository().auditVertexElementMutation(AuditAction.UPDATE, m, v, MULTI_VALUE_KEY, getUser(), data.getVisibility()); getAuditRepository().auditAnalyzedBy(AuditAction.ANALYZED_BY, v, getClass().getSimpleName(), getUser(), v.getVisibility()); getGraph().flush(); getWorkQueueRepository().pushGraphPropertyQueue(data.getElement(), MULTI_VALUE_KEY, LumifyProperties.TEXT.getPropertyName(), data.getWorkspaceId(), data.getVisibilitySource()); } }
TikaTextExtractorGraphPropertyWorker extends GraphPropertyWorker { @Override public void execute(InputStream in, GraphPropertyWorkData data) throws Exception { String mimeType = (String) data.getProperty().getMetadata().getValue(LumifyProperties.MIME_TYPE.getPropertyName()); checkNotNull(mimeType, LumifyProperties.MIME_TYPE.getPropertyName() + " is a required metadata field"); Charset charset = Charset.forName("UTF-8"); Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, mimeType); String text = extractText(in, mimeType, metadata); ExistingElementMutation<Vertex> m = data.getElement().prepareMutation(); String author = extractTextField(metadata, authorKeys); if (author != null && author.length() > 0) { LumifyProperties.AUTHOR.addPropertyValue(m, MULTI_VALUE_KEY, author, data.createPropertyMetadata(), data.getVisibility()); } String customImageMetadata = extractTextField(metadata, customFlickrMetadataKeys); org.securegraph.Metadata textMetadata = data.createPropertyMetadata(); LumifyProperties.MIME_TYPE.setMetadata(textMetadata, "text/plain", getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.META_DATA_TEXT_DESCRIPTION.setMetadata(textMetadata, "Extracted Text", getVisibilityTranslator().getDefaultVisibility()); if (customImageMetadata != null && !customImageMetadata.equals("")) { try { JSONObject customImageMetadataJson = new JSONObject(customImageMetadata); text = new JSONObject(customImageMetadataJson.get("description").toString()).get("_content") + "\n" + customImageMetadataJson.get("tags").toString(); StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); Date lastupdate = GenericDateExtractor .extractSingleDate(customImageMetadataJson.get("lastupdate").toString()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, lastupdate, data.createPropertyMetadata(), data.getVisibility()); org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, customImageMetadataJson.get("title").toString(), titleMetadata, data.getVisibility()); } catch (JSONException e) { LOGGER.warn("Image returned invalid custom metadata"); } } else { StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, extractDate(metadata), data.createPropertyMetadata(), data.getVisibility()); String title = extractTextField(metadata, subjectKeys).trim(); if (title != null && title.length() > 0) { org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, title, titleMetadata, data.getVisibility()); } if (pageCountProperty != null) { String numberOfPages = extractTextField(metadata, numberOfPagesKeys); if (numberOfPages != null) { org.securegraph.Metadata numberOfPagesMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(numberOfPagesMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); pageCountProperty.addPropertyValue(m, MULTI_VALUE_KEY, Long.valueOf(numberOfPages), numberOfPagesMetadata, data.getVisibility()); } } } Vertex v = m.save(getAuthorizations()); getAuditRepository().auditVertexElementMutation(AuditAction.UPDATE, m, v, MULTI_VALUE_KEY, getUser(), data.getVisibility()); getAuditRepository().auditAnalyzedBy(AuditAction.ANALYZED_BY, v, getClass().getSimpleName(), getUser(), v.getVisibility()); getGraph().flush(); getWorkQueueRepository().pushGraphPropertyQueue(data.getElement(), MULTI_VALUE_KEY, LumifyProperties.TEXT.getPropertyName(), data.getWorkspaceId(), data.getVisibilitySource()); }  }
TikaTextExtractorGraphPropertyWorker extends GraphPropertyWorker { @Override public void execute(InputStream in, GraphPropertyWorkData data) throws Exception { String mimeType = (String) data.getProperty().getMetadata().getValue(LumifyProperties.MIME_TYPE.getPropertyName()); checkNotNull(mimeType, LumifyProperties.MIME_TYPE.getPropertyName() + " is a required metadata field"); Charset charset = Charset.forName("UTF-8"); Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, mimeType); String text = extractText(in, mimeType, metadata); ExistingElementMutation<Vertex> m = data.getElement().prepareMutation(); String author = extractTextField(metadata, authorKeys); if (author != null && author.length() > 0) { LumifyProperties.AUTHOR.addPropertyValue(m, MULTI_VALUE_KEY, author, data.createPropertyMetadata(), data.getVisibility()); } String customImageMetadata = extractTextField(metadata, customFlickrMetadataKeys); org.securegraph.Metadata textMetadata = data.createPropertyMetadata(); LumifyProperties.MIME_TYPE.setMetadata(textMetadata, "text/plain", getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.META_DATA_TEXT_DESCRIPTION.setMetadata(textMetadata, "Extracted Text", getVisibilityTranslator().getDefaultVisibility()); if (customImageMetadata != null && !customImageMetadata.equals("")) { try { JSONObject customImageMetadataJson = new JSONObject(customImageMetadata); text = new JSONObject(customImageMetadataJson.get("description").toString()).get("_content") + "\n" + customImageMetadataJson.get("tags").toString(); StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); Date lastupdate = GenericDateExtractor .extractSingleDate(customImageMetadataJson.get("lastupdate").toString()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, lastupdate, data.createPropertyMetadata(), data.getVisibility()); org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, customImageMetadataJson.get("title").toString(), titleMetadata, data.getVisibility()); } catch (JSONException e) { LOGGER.warn("Image returned invalid custom metadata"); } } else { StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, extractDate(metadata), data.createPropertyMetadata(), data.getVisibility()); String title = extractTextField(metadata, subjectKeys).trim(); if (title != null && title.length() > 0) { org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, title, titleMetadata, data.getVisibility()); } if (pageCountProperty != null) { String numberOfPages = extractTextField(metadata, numberOfPagesKeys); if (numberOfPages != null) { org.securegraph.Metadata numberOfPagesMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(numberOfPagesMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); pageCountProperty.addPropertyValue(m, MULTI_VALUE_KEY, Long.valueOf(numberOfPages), numberOfPagesMetadata, data.getVisibility()); } } } Vertex v = m.save(getAuthorizations()); getAuditRepository().auditVertexElementMutation(AuditAction.UPDATE, m, v, MULTI_VALUE_KEY, getUser(), data.getVisibility()); getAuditRepository().auditAnalyzedBy(AuditAction.ANALYZED_BY, v, getClass().getSimpleName(), getUser(), v.getVisibility()); getGraph().flush(); getWorkQueueRepository().pushGraphPropertyQueue(data.getElement(), MULTI_VALUE_KEY, LumifyProperties.TEXT.getPropertyName(), data.getWorkspaceId(), data.getVisibilitySource()); }  @Override void prepare(GraphPropertyWorkerPrepareData workerPrepareData); @Override void execute(InputStream in, GraphPropertyWorkData data); @Override boolean isHandled(Element element, Property property); }
TikaTextExtractorGraphPropertyWorker extends GraphPropertyWorker { @Override public void execute(InputStream in, GraphPropertyWorkData data) throws Exception { String mimeType = (String) data.getProperty().getMetadata().getValue(LumifyProperties.MIME_TYPE.getPropertyName()); checkNotNull(mimeType, LumifyProperties.MIME_TYPE.getPropertyName() + " is a required metadata field"); Charset charset = Charset.forName("UTF-8"); Metadata metadata = new Metadata(); metadata.set(Metadata.CONTENT_TYPE, mimeType); String text = extractText(in, mimeType, metadata); ExistingElementMutation<Vertex> m = data.getElement().prepareMutation(); String author = extractTextField(metadata, authorKeys); if (author != null && author.length() > 0) { LumifyProperties.AUTHOR.addPropertyValue(m, MULTI_VALUE_KEY, author, data.createPropertyMetadata(), data.getVisibility()); } String customImageMetadata = extractTextField(metadata, customFlickrMetadataKeys); org.securegraph.Metadata textMetadata = data.createPropertyMetadata(); LumifyProperties.MIME_TYPE.setMetadata(textMetadata, "text/plain", getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.META_DATA_TEXT_DESCRIPTION.setMetadata(textMetadata, "Extracted Text", getVisibilityTranslator().getDefaultVisibility()); if (customImageMetadata != null && !customImageMetadata.equals("")) { try { JSONObject customImageMetadataJson = new JSONObject(customImageMetadata); text = new JSONObject(customImageMetadataJson.get("description").toString()).get("_content") + "\n" + customImageMetadataJson.get("tags").toString(); StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); Date lastupdate = GenericDateExtractor .extractSingleDate(customImageMetadataJson.get("lastupdate").toString()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, lastupdate, data.createPropertyMetadata(), data.getVisibility()); org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, customImageMetadataJson.get("title").toString(), titleMetadata, data.getVisibility()); } catch (JSONException e) { LOGGER.warn("Image returned invalid custom metadata"); } } else { StreamingPropertyValue textValue = new StreamingPropertyValue(new ByteArrayInputStream(text.getBytes(charset)), String.class); LumifyProperties.TEXT.addPropertyValue(m, MULTI_VALUE_KEY, textValue, textMetadata, data.getVisibility()); LumifyProperties.CREATE_DATE.addPropertyValue(m, MULTI_VALUE_KEY, extractDate(metadata), data.createPropertyMetadata(), data.getVisibility()); String title = extractTextField(metadata, subjectKeys).trim(); if (title != null && title.length() > 0) { org.securegraph.Metadata titleMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(titleMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); LumifyProperties.TITLE.addPropertyValue(m, MULTI_VALUE_KEY, title, titleMetadata, data.getVisibility()); } if (pageCountProperty != null) { String numberOfPages = extractTextField(metadata, numberOfPagesKeys); if (numberOfPages != null) { org.securegraph.Metadata numberOfPagesMetadata = data.createPropertyMetadata(); LumifyProperties.CONFIDENCE.setMetadata(numberOfPagesMetadata, SYSTEM_ASSIGNED_CONFIDENCE, getVisibilityTranslator().getDefaultVisibility()); pageCountProperty.addPropertyValue(m, MULTI_VALUE_KEY, Long.valueOf(numberOfPages), numberOfPagesMetadata, data.getVisibility()); } } } Vertex v = m.save(getAuthorizations()); getAuditRepository().auditVertexElementMutation(AuditAction.UPDATE, m, v, MULTI_VALUE_KEY, getUser(), data.getVisibility()); getAuditRepository().auditAnalyzedBy(AuditAction.ANALYZED_BY, v, getClass().getSimpleName(), getUser(), v.getVisibility()); getGraph().flush(); getWorkQueueRepository().pushGraphPropertyQueue(data.getElement(), MULTI_VALUE_KEY, LumifyProperties.TEXT.getPropertyName(), data.getWorkspaceId(), data.getVisibilitySource()); }  @Override void prepare(GraphPropertyWorkerPrepareData workerPrepareData); @Override void execute(InputStream in, GraphPropertyWorkData data); @Override boolean isHandled(Element element, Property property); static final String MULTI_VALUE_KEY; }