com.ldodds.foaf
Interface FOAFGraph

All Known Implementing Classes:
FOAFGraphImpl

public interface FOAFGraph

Author:
ldodds

Method Summary
 java.util.List findAllPeople()
          List all people mentioned in this graph.
 java.util.List findPersonByProperty(java.lang.String propertyURI, java.lang.String value)
          Find people by a particular FOAF property
 java.util.List findPersonWithProperty(java.lang.String propertyURI)
          Find people that have a particular FOAF property
 Person findPrimaryPerson()
          Find the primary person in the FOAFGraph.
 Person findPrimaryPerson(java.lang.String base)
          Finds the primary person in the FOAFGraph.
 void smush()
          Smush this graph to de-duplicate the data.
 

Method Detail

findPrimaryPerson

public Person findPrimaryPerson()
Find the primary person in the FOAFGraph. This version of the findPrimaryPerson method is only suitable for calling on graphs that contain a single FOAF document. For more general graphs that include triples from multiple documents (e.g. as the result of a scutter), then use the alternate version of this method, specifying the baseURI of the document being queried.

Returns:
the primary Person or null if not found
See Also:
findPrimaryPerson(String)

findPrimaryPerson

public Person findPrimaryPerson(java.lang.String base)
Finds the primary person in the FOAFGraph.

Find the primary person associated with a FOAF document from a specific URI. The algorithm first attempts to see whether the primary person is explicitly labelled (i.e. foaf:primaryTopic of a foaf:PersonalProfileDocument). Otherwise it looks for the author (foaf:maker, then dc:creator) of that document.

Parameters:
base - the URI of the document
Returns:
the primary Person or null if not found

findAllPeople

public java.util.List findAllPeople()
List all people mentioned in this graph.

Produces a list of Person objects, one for every foaf:Person in the graph, regardless of relationship or origin.

Returns:
a List of Person objects. May be empty.

findPersonByProperty

public java.util.List findPersonByProperty(java.lang.String propertyURI,
                                           java.lang.String value)
Find people by a particular FOAF property

Parameters:
propertyURI - the URI of the property
value - the value of the property to match on
Returns:
a list of people with this property and value

findPersonWithProperty

public java.util.List findPersonWithProperty(java.lang.String propertyURI)
Find people that have a particular FOAF property

Parameters:
propertyURI - the URI of the property
Returns:
a list of people with this property

smush

public void smush()
Smush this graph to de-duplicate the data.