HI,
Finally I succeed to call the
function UpdateExecutionFactory.createRemote. Thanks for the comments.
Here is my configuration
Fuseki server
java -Xmx1200M -jar fuseki-server.jar --update --mem
--loc=D:/fuseki-0.2.2/TD /ds2
and the insert query code
public class search {
static final String inputFileName = "http://localhost:3030/";
public static void main(String[] args) throws IOException{
Model model =ModelFactory.createOntologyModel();
// use the FileManager to find the input file
InputStream in = FileManager.get().open(inputFileName);
if (in == null) {
throw new IllegalArgumentException( "File: " + inputFileName +
" not found");
}
model.read(inputFileName+"per2.owl");
in.close();
String queryString ="PREFIX xmlns:
<http://localhost:3030/per1.owl#>\r\n"
+
"PREFIX base: <http://localhost:3030/per1.owl
>\r"+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\r"+
"INSERT DATA" +
"{"+
"<http://localhost:3030/per1.owl#name1>\n" +
"xmlns:hasFirstname \"Rex\"^^ xsd:string;" +
"}";
GraphStore gs=GraphStoreFactory.create(model);
gs.setDefaultGraph(model.getGraph());
UpdateRequest ur = UpdateFactory.create(queryString);
Update update = ur.getOperations().get(0);
UpdateExecutionFactory.createRemote(ur,"
http://localhost:3030/per2.owl");
UpdateAction.execute(ur,gs);
System.out.println(update);
// some codes ....
qe.close();
}
}
I am wondering why it is not updating the ontology??
regards
On Thu, Jun 7, 2012 at 1:21 AM, Andy Seaborne <[email protected]> wrote:
> On 07/06/12 05:03, Don S wrote:
>
>> HI,
>>
>> Based on the suggestion I inserted all the six file that are necessary
>> for
>> running the createRemote.
>>
>
> Only jena-arq-2.9.1-20120604.**050404-22.jar is needed - in fact, you
> must not have the others on the build classpath.
>
>
> But still it showing 'The method
>> createRemote(UpdateRequest, String) is undefined for the type
>> UpdateExecutionFactory" when I keep my mouse cursor in the
>> createRemote position. Instead of displaying UpdateExecutionFactory
>> com.hp.hpl.....
>>
>
> Works for me:
>
> public static UpdateProcessor createRemote(UpdateRequest updateRequest,
> String remoteEndpoint)
> {
> return new UpdateProcessRemote(**updateRequest, remoteEndpoint) ;
> }
>
> and Eclipse finds it.
>
> (which IDE are youusing?)
>
> Possibilities include:
> 1/ Other versions on the build classpath
>
> 2/ You did not refresh the project after copying files around
>
> 3/ You have put the source jars on the classpath, not or as well as, the
> binaries. You must only put the binaries on (and attach the source to that
> entry in Eclipse terminology). You do not need the source files (or the
> javadoc, or the tests or the source tests).
>
> If you are using Eclipse what does .classpath have in it?
>
> If you are using a different IDE, you'll have to check that.
>
> Andy
>
>
>>
>> I don't know is it because of my configuration.
>>
>> Initially I installed jena-arq-2.9.0 from
>> https://repository.apache.org/**content/repositories/releases/**
>> org/apache/jena/jena-arq/2.9.**0-incubating/<https://repository.apache.org/content/repositories/releases/org/apache/jena/jena-arq/2.9.0-incubating/>
>> After that I copied
>>
>> jena-arq-2.9.1-20120604.**050404-22
>> jena-arq-2.9.1-20120604.**050404-22-javadoc
>> jena-arq-2.9.1-20120604.**050404-22-sources
>> jena-arq-2.9.1-20120604.**050404-22-tests
>> jena-arq-2.9.1-20120604.**050404-22-test-sources
>>
>> these files into the arq-2.9.0 directory and deleted these files
>>
>> jena-arq-2.9.0-incubating
>> jena-arq-2.9.0-incubating-**javadoc
>> jena-arq-2.9.0-incubating-**sources
>> jena-arq-2.9.0-incubating-test
>> jena-arq-2.9.0-incubating-**tets-sourse
>>
>> And copied or overwrite the files needed for running
>> the createRemote method.
>> * /incubator/jena/Jena2/ARQ/****trunk/bin/rupdate
>> * /incubator/jena/Jena2/ARQ/****trunk/bin2/rupdate
>> * /incubator/jena/Jena2/ARQ/****trunk/src/main/java/arq/****rupdate.java
>> * /incubator/jena/Jena2/ARQ/****trunk/src/main/java/arq/****update.java
>> */incubator/jena/Jena2/ARQ/****trunk/src/main/java/com/hp/**
>> hpl/jena/sparql/modify/****UpdateProcessRemote.java
>> */incubator/jena/Jena2/ARQ/****trunk/src/main/java/com/hp/****
>> hpl/jena/update/****UpdateExecutionFactory.java
>>
>>
>>
>> Will this kind of configuration is making problem for calling the
>> method.Or
>> should I need
>> separate jena-arq-2.9.1-20120604.**050404-22 -source-release.zip file
>> to run.
>>
>
> No
>
>
>> Regards
>> Don
>>
>>
>>
>>
>> On Mon, Jun 4, 2012 at 9:12 AM, Andy Seaborne<[email protected]> wrote:
>>
>> On 04/06/12 02:20, Don S wrote:
>>>
>>> HI,
>>>>
>>>> I was trying to run the function UpdateExecutionFactory.****
>>>> createRemote.
>>>>
>>>> I
>>>> installed jena-arq-2.9.1-
>>>> 20120601.050620-20 /.* files to run SPARQl update remotely.
>>>>
>>>> But I cannot find these files inside
>>>> Files :
>>>> * /incubator/jena/Jena2/ARQ/****trunk/bin/rupdate
>>>> * /incubator/jena/Jena2/ARQ/****trunk/bin2/rupdate
>>>> * /incubator/jena/Jena2/ARQ/****trunk/src/main/java/arq/****
>>>> rupdate.java
>>>> * /incubator/jena/Jena2/ARQ/****trunk/src/main/java/arq/****update.java
>>>>
>>>>
>>> jena is now a top-level project
>>>
>>> /jena/trunk/jena-arq
>>>
>>> *
>>>
>>>> /incubator/jena/Jena2/ARQ/****trunk/src/main/java/com/hp/**
>>>> hpl/jena/sparql/modify/****UpdateProcessRemote.java
>>>> *
>>>> /incubator/jena/Jena2/ARQ/****trunk/src/main/java/com/hp/****
>>>> hpl/jena/update/
>>>> **UpdateExecutionFactory.java
>>>>
>>>> *
>>>> *https://issues.apache.org/****jira/browse/JENA-197<https://issues.apache.org/**jira/browse/JENA-197>
>>>> <https://**issues.apache.org/jira/browse/**JENA-197<https://issues.apache.org/jira/browse/JENA-197>
>>>> >
>>>>
>>>>
>>>> Please give me a solution for running UpdateExecutionFactory.**
>>>>
>>>> createRemote().
>>>> Which ARQ version include these files.
>>>>
>>>>
>>> current.
>>>
>>>
>>> Regards
>>>> Don
>>>>
>>>>
>>>> The scripts are also in apache-jena which is built once a day to track
>>> development.
>>>
>>> Andy
>>>
>>>
>>>
>>
>