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