All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fcrepo.server.security.xacml.util.RelationshipResolver Maven / Gradle / Ivy


package org.fcrepo.server.security.xacml.util;

import java.util.Map;
import java.util.Set;

import org.fcrepo.server.security.xacml.MelcoeXacmlException;


public interface RelationshipResolver {


    /**
     * Retrieves the relationships for this subject. Values for each relationship
     * are placed in a map.  Return empty map if none found
     *
     * @param subject
     *        the subject to return relationships for - either ns:pid,
     *        ns:pid/datastream or the info:fedora/ forms
     * @return The map of relationships and values.
     * @throws MelcoeXacmlException
     */
    public Map> getRelationships(String subject)
            throws MelcoeXacmlException;


    /**
     * Retrieves relationships for this subject, relationship and object.  Return
     * empty map if none found.  Null means any.
     *
     * @param subject
     * @param relationship
     * @param object
     * @return
     * @throws MelcoeXacmlException
     */
    public Map> getRelationships(String subject,
                                                      String relationship) throws MelcoeXacmlException;

    /**
     * Obtains a list of parents for the given pid.
     *
     * @param pid
     *        object id whose parents we wish to find
     * @return a Set containing the parents of the pid
     * @throws PEPException
     */
    // FIXME: not used?
    //public Set getParents(String pid) throws MelcoeXacmlException;

    /**
     * Generates a REST based representation of an object and its parents. For
     * example, given the parameter b, and if b belongs to collection a, then we
     * will end up with /a/b
     *
     * @param pid
     *        the pid whose parents we need to find
     * @return the REST representation of the pid and its parents
     * @throws PEPException
     */
    public String buildRESTParentHierarchy(String pid)
            throws MelcoeXacmlException;

    /**
     * Get attributes defined by a query.
     *
     * The values returned are defined by the variable defined in the query
     *
     * Only distinct values are returned.
     *
     * @param query The query to run
     * @param queryLang Language of the query - itql, sparql, spo
     * @param variable - the output variable to return (for spo, specify "s", "p" or "o")
     * @return
     * @throws MelcoeXacmlException
     */
    public Set getAttributesFromQuery(String query, String queryLang, String variable) throws MelcoeXacmlException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy