1 5 6 package org.joseki.server.processors; 7 8 import org.joseki.server.*; 9 import org.joseki.vocabulary.*; 10 11 import com.hp.hpl.jena.rdf.model.*; 12 13 18 public class AddProcessor extends OneArgProcessor 19 { 20 public AddProcessor() 21 { 22 super("add", ProcessorCom.WriteOperation, ProcessorCom.MutatesModel) ; 23 } 24 25 public String getInterfaceURI() { return JosekiVocab.opAdd ; } 26 27 public Model execOneArg(ModelSource src, Model graph, Request req) 28 throws RDFException, ExecutionException 29 { 30 if (!(src instanceof ModelSourceJena)) 31 throw new ExecutionException( 32 ExecutionError.rcOperationNotSupported, 33 "Wrong implementation - this Fetch processor works with Jena models"); 34 Model target = ((ModelSourceJena)src).getModel() ; 35 36 target.add(graph) ; 37 return super.emptyModel ; 38 } 39 } 40 41 42 68 | Popular Tags |