Skip to content

Commit

Permalink
add unsupported operation exceptions for api methods that are not sup…
Browse files Browse the repository at this point in the history
…ported in m2.
  • Loading branch information
Bill Millar committed Dec 15, 2009
1 parent be4b3c3 commit eff6cd6
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 191 deletions.
80 changes: 0 additions & 80 deletions src/com/franz/agraph/jena/AGGraph.java
Expand Up @@ -26,7 +26,6 @@
import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleMatch; import com.hp.hpl.jena.graph.TripleMatch;
import com.hp.hpl.jena.graph.impl.GraphBase; import com.hp.hpl.jena.graph.impl.GraphBase;
import com.hp.hpl.jena.graph.query.QueryHandler;
import com.hp.hpl.jena.shared.AddDeniedException; import com.hp.hpl.jena.shared.AddDeniedException;
import com.hp.hpl.jena.shared.DeleteDeniedException; import com.hp.hpl.jena.shared.DeleteDeniedException;
import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.shared.PrefixMapping;
Expand Down Expand Up @@ -71,100 +70,21 @@ AGRepositoryConnection getConnection() {
public void close() { public void close() {
} }


/*
* @Override public boolean contains(Triple t) { // TODO Auto-generated
* method stub return false; }
*
* @Override public boolean contains(Node s, Node p, Node o) { // TODO
* Auto-generated method stub return false; }
*/

/*
* @Override public void delete(Triple t) throws DeleteDeniedException { try
* { conn.remove(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
* vf.asValue(t.getObject()), context); } catch (UnauthorizedException e) {
* throw new DeleteDeniedException(e.getMessage()); } catch
* (RepositoryException e) { throw new RuntimeException(e); } }
*
* @Override public boolean dependsOn(Graph other) { // TODO Auto-generated
* method stub return false; }
*
* @Override public ExtendedIterator<Triple> find(TripleMatch m) { return
* find(m.getMatchSubject(),m.getMatchPredicate(),m.getMatchObject()); }
*
* @Override public ExtendedIterator<Triple> find(Node s, Node p, Node o) {
* RepositoryResult<Statement> result; try { result =
* conn.getStatements(vf.asResource(s), vf.asURI(p), vf.asValue(o), false,
* context); } catch (RepositoryException e) { throw new
* RuntimeException(e); } return new AGTripleIterator(result); }
*/

@Override @Override
public BulkUpdateHandler getBulkUpdateHandler() { public BulkUpdateHandler getBulkUpdateHandler() {
return new AGBulkUpdateHandler(this); return new AGBulkUpdateHandler(this);
} }


/*
* @Override public Capabilities getCapabilities() { // TODO Auto-generated
* method stub return null; }
*
* @Override public GraphEventManager getEventManager() { // TODO
* Auto-generated method stub return null; }
*/

@Override @Override
public PrefixMapping getPrefixMapping() { public PrefixMapping getPrefixMapping() {
return new AGPrefixMapping(this); return new AGPrefixMapping(this);
} }


/*
* @Override public Reifier getReifier() { return reifier; }
*
* @Override public GraphStatisticsHandler getStatisticsHandler() { // TODO
* Auto-generated method stub return null; }
*/

@Override @Override
public TransactionHandler getTransactionHandler() { public TransactionHandler getTransactionHandler() {
return new AGTransactionHandler(this); return new AGTransactionHandler(this);
} }


/*
* @Override public boolean isClosed() { // TODO Auto-generated method stub
* return false; }
*
* @Override public boolean isEmpty() { // TODO Auto-generated method stub
* return false; }
*
* @Override public boolean isIsomorphicWith(Graph g) { // TODO
* Auto-generated method stub return false; }
*/

@Override
public QueryHandler queryHandler() {
// TODO Auto-generated method stub
return null;
}

/*
* @Override public int size() { // TODO deal with graphs bigger than int's.
* int size; try { size = (int)conn.size(context); } catch
* (RepositoryException e) { // TODO: proper exception to throw? throw new
* RuntimeException(e); } return size; }
*
@Override
public void add(Triple t) throws AddDeniedException {
try {
conn.add(vf.asResource(t.getSubject()), vf.asURI(t.getPredicate()),
vf.asValue(t.getObject()), context);
} catch (UnauthorizedException e) {
throw new AddDeniedException(e.getMessage());
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
}*/

@Override @Override
public String toString() { public String toString() {
if (graphNode == null) if (graphNode == null)
Expand Down
18 changes: 6 additions & 12 deletions src/com/franz/agraph/jena/AGGraphMaker.java
Expand Up @@ -41,8 +41,7 @@ public AGGraph getGraph() {


@Override @Override
public AGGraph createGraph() { public AGGraph createGraph() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
Expand All @@ -58,26 +57,22 @@ public AGGraph createGraph(String uri, boolean strict) {


@Override @Override
public ReificationStyle getReificationStyle() { public ReificationStyle getReificationStyle() {
// TODO Auto-generated method stub return ReificationStyle.Minimal;
return null;
} }


@Override @Override
public boolean hasGraph(String name) { public boolean hasGraph(String name) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return false;
} }


@Override @Override
public ExtendedIterator<String> listGraphs() { public ExtendedIterator<String> listGraphs() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public AGGraph openGraph() { public AGGraph openGraph() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
Expand All @@ -93,8 +88,7 @@ public AGGraph openGraph(String uri, boolean strict) {


@Override @Override
public void removeGraph(String name) { public void removeGraph(String name) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);

} }


} }
29 changes: 7 additions & 22 deletions src/com/franz/agraph/jena/AGInfGraph.java
Expand Up @@ -34,26 +34,22 @@ public class AGInfGraph extends AGGraph implements InfGraph {
@Override @Override
public ExtendedIterator<Triple> find(Node subject, Node property, public ExtendedIterator<Triple> find(Node subject, Node property,
Node object, Graph param) { Node object, Graph param) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public Graph getDeductionsGraph() { public Graph getDeductionsGraph() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public Iterator<Derivation> getDerivation(Triple triple) { public Iterator<Derivation> getDerivation(Triple triple) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public Node getGlobalProperty(Node property) { public Node getGlobalProperty(Node property) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
Expand All @@ -68,44 +64,33 @@ public Reasoner getReasoner() {


@Override @Override
public void prepare() { public void prepare() {
// TODO Auto-generated method stub

} }


@Override @Override
public void rebind() { public void rebind() {
// TODO Auto-generated method stub

} }


@Override @Override
public void rebind(Graph data) { public void rebind(Graph data) {
// TODO Auto-generated method stub

} }


@Override @Override
public void reset() { public void reset() {
// TODO Auto-generated method stub

} }


@Override @Override
public void setDerivationLogging(boolean logOn) { public void setDerivationLogging(boolean logOn) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);

} }


@Override @Override
public boolean testGlobalProperty(Node property) { public boolean testGlobalProperty(Node property) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return false;
} }


@Override @Override
public ValidityReport validate() { public ValidityReport validate() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }




Expand Down
22 changes: 5 additions & 17 deletions src/com/franz/agraph/jena/AGInfModel.java
Expand Up @@ -34,14 +34,12 @@ public AGInfModel(AGReasoner reasoner, AGModel baseModel) {


@Override @Override
public Model getDeductionsModel() { public Model getDeductionsModel() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public Iterator<Derivation> getDerivation(Statement statement) { public Iterator<Derivation> getDerivation(Statement statement) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
Expand All @@ -51,45 +49,35 @@ public Model getRawModel() {


@Override @Override
public Reasoner getReasoner() { public Reasoner getReasoner() {
// TODO Auto-generated method stub
return reasoner; return reasoner;
} }


@Override @Override
public StmtIterator listStatements(Resource subject, Property predicate, public StmtIterator listStatements(Resource subject, Property predicate,
RDFNode object, Model posit) { RDFNode object, Model posit) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public void prepare() { public void prepare() {
// TODO Auto-generated method stub

} }


@Override @Override
public void rebind() { public void rebind() {
// TODO Auto-generated method stub

} }


@Override @Override
public void reset() { public void reset() {
// TODO Auto-generated method stub

} }


@Override @Override
public void setDerivationLogging(boolean logOn) { public void setDerivationLogging(boolean logOn) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);

} }


@Override @Override
public ValidityReport validate() { public ValidityReport validate() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }




Expand Down
26 changes: 9 additions & 17 deletions src/com/franz/agraph/jena/AGPrefixMapping.java
Expand Up @@ -31,8 +31,7 @@ AGGraph getGraph() {


@Override @Override
public String expandPrefix(String prefixed) { public String expandPrefix(String prefixed) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
Expand Down Expand Up @@ -81,26 +80,22 @@ public String getNsURIPrefix(String uri) {


@Override @Override
public PrefixMapping lock() { public PrefixMapping lock() {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public String qnameFor(String uri) { public String qnameFor(String uri) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public PrefixMapping removeNsPrefix(String prefix) { public PrefixMapping removeNsPrefix(String prefix) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public boolean samePrefixMappingAs(PrefixMapping other) { public boolean samePrefixMappingAs(PrefixMapping other) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return false;
} }


@Override @Override
Expand All @@ -115,26 +110,23 @@ public PrefixMapping setNsPrefix(String prefix, String uri) {


@Override @Override
public PrefixMapping setNsPrefixes(PrefixMapping other) { public PrefixMapping setNsPrefixes(PrefixMapping other) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public PrefixMapping setNsPrefixes(Map<String, String> map) { public PrefixMapping setNsPrefixes(Map<String, String> map) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public String shortForm(String uri) { public String shortForm(String uri) {
// TODO Auto-generated method stub throw new UnsupportedOperationException(AGUnsupportedOperation.message);
return null;
} }


@Override @Override
public PrefixMapping withDefaultMappings(PrefixMapping map) { public PrefixMapping withDefaultMappings(PrefixMapping map) {
// TODO Auto-generated method stub
return null; return null;
//throw new UnsupportedOperationException(AGUnsupportedOperation.message);
} }


} }

0 comments on commit eff6cd6

Please sign in to comment.