Package org.securegraph

Examples of org.securegraph.Visibility


        String password = cmd.getOptionValue(CMD_OPT_PASSWORD);
        String idPrefix = cmd.getOptionValue(CMD_OPT_ID_PREFIX, "palantir");
        String outdir = cmd.getOptionValue(CMD_OPT_OUT_DIR);
        String owlPrefix = cmd.getOptionValue(CMD_OPT_OWL_PREFIX);
        boolean ontologyExport = cmd.hasOption(CMD_OPT_ONTOLOGY_EXPORT);
        Visibility visibility = new Visibility("");
        Authorizations authorizations = getAuthorizations();

        String hasMediaConceptTypeIri = getConfiguration().get("ontology.iri.hasMedia");
        if (hasMediaConceptTypeIri == null || hasMediaConceptTypeIri.length() == 0) {
            throw new LumifyException("'ontology.iri.hasMedia' is required.");
View Full Code Here


    @Test
    public void testEntityExtraction() throws Exception {
        JSONObject visibilityJson = new JSONObject();
        visibilityJson.put("source", "");
        Vertex vertex = graph.prepareVertex("v1", new Visibility(""))
                .setProperty("text", "none", new Visibility(""))
                .setProperty(LumifyProperties.VISIBILITY_JSON.getPropertyName(), visibilityJson, new Visibility(""))
                .save(new InMemoryAuthorizations());

        GraphPropertyWorkData workData = new GraphPropertyWorkData(vertex, vertex.getProperty("text"), null, null);
        extractor.setVisibilityTranslator(visibilityTranslator);
        extractor.execute(new ByteArrayInputStream(text.getBytes("UTF-8")), workData);
View Full Code Here

    @Test
    public void testEntityExtraction() throws Exception {
        JSONObject visibilityJson = new JSONObject();
        visibilityJson.put("source", "");
        InMemoryVertex vertex = (InMemoryVertex) graph.prepareVertex("v1", new Visibility(""))
                .setProperty("text", "none", new Visibility(""))
                .setProperty(LumifyProperties.VISIBILITY_JSON.getPropertyName(), visibilityJson, new Visibility(""))
                .save(new InMemoryAuthorizations());
        graph.flush();

        GraphPropertyWorkData workData = new GraphPropertyWorkData(vertex, vertex.getProperty("text"), null, "");
        extractor.execute(new ByteArrayInputStream(text.getBytes()), workData);
View Full Code Here

        final String metadataString = getOptionalParameter(request, "metadata");
        User user = getUser(request);
        String workspaceId = getActiveWorkspaceId(request);
        Authorizations authorizations = getAuthorizations(request, user);

        if (!graph.isVisibilityValid(new Visibility(visibilitySource), authorizations)) {
            LOGGER.warn("%s is not a valid visibility for %s user", visibilitySource, user.getDisplayName());
            respondWithBadRequest(response, "visibilitySource", getString(request, "visibility.invalid"));
            chain.next(request, response);
            return;
        }
View Full Code Here

        String propertyValue = propertyJson.optString("value", null);
        checkNotNull(propertyValue, "value is required: " + propertyJson.toString());

        String visibilitySource = propertyJson.optString("visibilitySource", null);
        Visibility visibility;
        if (visibilitySource == null) {
            visibility = data.getVisibility();
        } else {
            visibility = new Visibility(visibilitySource);
        }

        Map<String, Object> metadata = new HashMap<String, Object>();
        LumifyProperties.VISIBILITY_JSON.setMetadata(metadata, GraphUtil.updateVisibilitySource(null, visibilitySource));
View Full Code Here

public class LumifyVisibility {
    public static final String SUPER_USER_VISIBILITY_STRING = "lumify";
    private final Visibility visibility;

    public LumifyVisibility() {
        this.visibility = new Visibility("");
    }
View Full Code Here

        this.visibility = new Visibility("");
    }

    public LumifyVisibility(String visibility) {
        if (visibility == null || visibility.length() == 0) {
            this.visibility = new Visibility("");
        } else {
            this.visibility = new Visibility("(" + visibility + ")|" + SUPER_USER_VISIBILITY_STRING);
        }
    }
View Full Code Here

        return getVisibility().toString();
    }

    public static Visibility and(Visibility visibility, String additionalVisibility) {
        if (visibility.getVisibilityString().length() == 0) {
            return new Visibility(additionalVisibility);
        }
        return new Visibility("(" + visibility.getVisibilityString() + ")&(" + additionalVisibility + ")");
    }
View Full Code Here

    private AccumuloAuthorizations authorizations;

    @Override
    protected void setup(Context context) throws IOException, InterruptedException {
        super.setup(context);
        this.visibility = new Visibility("");
        this.authorizations = new AccumuloAuthorizations();
    }
View Full Code Here

        getGraph().flush();
    }

    private void setProperty(String iri, Object value, ExistingElementMutation<Vertex> mutation, Map<String, Object> metadata, GraphPropertyWorkData data, List<String> properties) {
        if (iri != null && value != null) {
            mutation.addPropertyValue(MULTI_VALUE_PROPERTY_KEY, iri, value, metadata, new Visibility(data.getVisibilitySource()));
            properties.add(iri);
        }
    }
View Full Code Here

TOP

Related Classes of org.securegraph.Visibility

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.