com.ldodds.foaf.jena
Class FOAFGraphImpl

java.lang.Object
  extended bycom.ldodds.foaf.jena.FOAFGraphImpl
All Implemented Interfaces:
FOAFGraph

public class FOAFGraphImpl
extends java.lang.Object
implements FOAFGraph

Author:
ldodds

Constructor Summary
FOAFGraphImpl(Model model)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FOAFGraphImpl

public FOAFGraphImpl(Model model)
Method Detail

smush

public void smush()
Description copied from interface: FOAFGraph
Smush this graph to de-duplicate the data.

Specified by:
smush in interface FOAFGraph
See Also:
FOAFGraph.smush()

findAllPeople

public java.util.List findAllPeople()
Description copied from interface: FOAFGraph
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.

Specified by:
findAllPeople in interface FOAFGraph
Returns:
a List of Person objects. May be empty.
See Also:
FOAFGraph.findAllPeople()

findPrimaryPerson

public Person findPrimaryPerson(java.lang.String base)
Description copied from interface: FOAFGraph
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.

Specified by:
findPrimaryPerson in interface FOAFGraph
Parameters:
base - the URI of the document
Returns:
the primary Person or null if not found
See Also:
FOAFGraph.findPrimaryPerson(String)

findPrimaryPerson

public Person findPrimaryPerson()
Description copied from interface: FOAFGraph
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.

Specified by:
findPrimaryPerson in interface FOAFGraph
Returns:
the primary Person or null if not found
See Also:
FOAFGraph.findPrimaryPerson()

findPersonWithProperty

public java.util.List findPersonWithProperty(java.lang.String propertyURI)
Description copied from interface: FOAFGraph
Find people that have a particular FOAF property

Specified by:
findPersonWithProperty in interface FOAFGraph
Parameters:
propertyURI - the URI of the property
Returns:
a list of people with this property
See Also:
FOAFGraph.findPersonWithProperty(java.lang.String)

findPersonByProperty

public java.util.List findPersonByProperty(java.lang.String propertyURI,
                                           java.lang.String value)
Description copied from interface: FOAFGraph
Find people by a particular FOAF property

Specified by:
findPersonByProperty in interface FOAFGraph
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
See Also:
FOAFGraph.findPersonByProperty(java.lang.String, java.lang.String)