View Javadoc

1   package uk.ac.cam.spectra;
2   
3   import java.io.Serializable;
4   import java.net.URI;
5   
6   import com.hp.hpl.jena.rdf.model.Model;
7   import com.hp.hpl.jena.rdf.model.Property;
8   import com.hp.hpl.jena.rdf.model.RDFNode;
9   import com.hp.hpl.jena.rdf.model.Resource;
10  
11  /**
12   * A munging of a predicate URI and object type, to remove some of the
13   * complexities of RDF and XSI types from API clients.
14   * 
15   * @author ojd20
16   * 
17   */
18  public interface MetadataProperty extends Serializable {
19  
20  	/**
21  	 * Predicate element name.
22  	 * 
23  	 * @return
24  	 */
25  	String getElement();
26  
27  	/**
28  	 * Predicate namespace.
29  	 * 
30  	 * @return
31  	 */
32  	String getNamespace();
33  
34  	/**
35  	 * Get predicate URI.
36  	 * 
37  	 * @return
38  	 */
39  	URI toURI();
40  
41  	/**
42  	 * Convenience method when dealing with frameworks that model uris as
43  	 * strings.
44  	 * 
45  	 * @return
46  	 */
47  	String toURIString();
48  
49  	boolean isLiteral();
50  
51  	String getXsiType();
52  
53  	boolean valid(RDFNode value, Model targetModel);
54  
55  	Property asProperty(Model m);
56  
57  	String decode(RDFNode value);
58  
59  	void add(Resource targetResource, Object value);
60  
61  }