001: /*
002: * LICENSE INFORMATION
003: * Copyright 2005-2007 by FZI (http://www.fzi.de).
004: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
005: * <OWNER> = Max Völkel
006: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
007: * <YEAR> = 2007
008: *
009: * Project information at http://semweb4j.org/rdf2go
010: */
011: package org.ontoware.rdf2go.model;
012:
013: import java.util.Iterator;
014:
015: import org.ontoware.rdf2go.exception.ModelRuntimeException;
016: import org.ontoware.rdf2go.model.node.Node;
017: import org.ontoware.rdf2go.model.node.Resource;
018: import org.ontoware.rdf2go.model.node.URI;
019:
020: /**
021: *
022: * @author voelkel
023: */
024: public interface ModelWriter {
025:
026: /**
027: * adds a statement to this model
028: *
029: * @param statement the statement to add
030: * @throws ModelRuntimeException
031: */
032: public void addStatement(Statement statement)
033: throws ModelRuntimeException;
034:
035: /**
036: * Add all statements contained in 'other' to this model = 'union'
037: *
038: * @param other
039: * another RDF2GO model
040: * @throws ModelRuntimeException
041: */
042: public void addAll(Iterator<? extends Statement> other)
043: throws ModelRuntimeException;
044:
045: /**
046: * adds a (subject, property ,object)-statement to this model
047: *
048: * @param subject
049: * @param predicate
050: * @param object
051: * @throws ModelRuntimeException
052: */
053: public void addStatement(Resource subject, URI predicate,
054: Node object) throws ModelRuntimeException;
055:
056: /**
057: * adds a (subject, property, liteal, language-tag)-statement to the model.
058: * This method is intended to give the user convenience and allows the
059: * underlying implementation to convert directly to native objects without
060: * converting to RDF2Go objects first.
061: *
062: * @param subject
063: * URI or Object (= blankNode)
064: * @param predicate
065: * @param literal
066: * @param languageTag
067: * RDF language tag
068: * @throws ModelRuntimeException
069: */
070: public void addStatement(Resource subject, URI predicate,
071: String literal, String languageTag)
072: throws ModelRuntimeException;
073:
074: /**
075: * adds a (subject, property, literal ,datatype)-statement to the model.
076: * This method is intended to give the user convenience and allows the
077: * underlying implementation to convert directly to native objects without
078: * converting to RDF2Go objects first.
079: *
080: * datatype normaly is an uri for a xml schema datatype (xsd)
081: *
082: * @param subject
083: * @param predicate
084: * @param literal
085: * @param datatypeURI
086: * @throws ModelRuntimeException
087: */
088: public void addStatement(Resource subject, URI predicate,
089: String literal, URI datatypeURI)
090: throws ModelRuntimeException;
091:
092: /**
093: * adds a (subject, property, literal)-statement to the model. This method
094: * is intended to give the user convenience and allows the underlying
095: * implementation to convert directly to native objects without converting
096: * to RDF2Go objects first.
097: *
098: * @param subject
099: * @param predicate
100: * @param literal
101: * @throws ModelRuntimeException
102: */
103: public void addStatement(Resource subject, URI predicate,
104: String literal) throws ModelRuntimeException;
105:
106: /**
107: * adds a (subject, property, liteal, language-tag)-statement to the model.
108: * This method is intended to give the user convenience and allows the
109: * underlying implementation to convert directly to native objects without
110: * converting to RDF2Go objects first.
111: *
112: * @param subject -
113: * interpretded as a URI
114: * @param predicate
115: * @param literal
116: * @param languageTag
117: * RDF language tag
118: * @throws ModelRuntimeException
119: */
120: public void addStatement(String subjectURIString, URI predicate,
121: String literal, String languageTag)
122: throws ModelRuntimeException;
123:
124: /**
125: * adds a (subject, property, literal ,datatype)-statement to the model.
126: * This method is intended to give the user convenience and allows the
127: * underlying implementation to convert directly to native objects without
128: * converting to RDF2Go objects first.
129: *
130: * datatype normaly is an uri for a xml schema datatype (xsd)
131: *
132: * @param subject
133: * @param predicate
134: * @param literal
135: * @param datatypeURI
136: * @throws ModelRuntimeException
137: */
138: public void addStatement(String subjectURIString, URI predicate,
139: String literal, URI datatypeURI)
140: throws ModelRuntimeException;
141:
142: /**
143: * adds a (subject, property, literal)-statement to the model. This method
144: * is intended to give the user convenience and allows the underlying
145: * implementation to convert directly to native objects without converting
146: * to RDF2Go objects first.
147: *
148: * @param subject
149: * @param predicate
150: * @param literal
151: * @throws ModelRuntimeException
152: */
153: public void addStatement(String subjectURIString, URI predicate,
154: String literal) throws ModelRuntimeException;
155:
156: }
|