Hi Rupert,
Thank you for explanations. 
I am still not able to find out what is the parsed URI that Stanbol uses. I 
create a named entity (Marry Smith) using this file 

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
  xmlns="http://schema.org/";
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
  xmlns:foaf="http://xmlns.com/foaf/0.1/";
  xml:base="file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/">
  
 <Person rdf:about="Marry.Smith.rdf#Marry_Smith">
        <rdf:label>Marry Smith</rdf:label>
        <foaf:name>Marry Smith</foaf:name>              
    </Person>
    
</rdf:RDF>      

by POSTing it with cURL

C:\EntityPerson>curl -i -X POST -H "Content-Type:application/rdf+xml" -T 
Marry.Smith.rdf "http://localhost:8080/entityhub/site/r2HR/entity";
HTTP/1.1 201 Created
Date: Mon, 29 Jun 2015 18:48:15 GMT
Location: 
http://localhost:8080/entityhub/site/r2HR/entity?id=file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_Smith
Accept: application/json
Content-Length: 0
Server: Jetty(7.x.y-SNAPSHOT)

Then I try to erase it by using its ID from above, but it is not recognized as 
a valid one:

C:\Users\Acer\Documents\Semantic\Stanbol\EntityPerson>curl -X DELETE 
"http://localhost:8080/entityhub/site/r2HR/entity?id=file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPer
son/Marry.Smith.rdf#Marry_Smith"
No Entity with the parsed Id 
'file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf' 
is present on the ManagedSite 'r2HR'!

However, if I attempt to POST it again (not to update, with PUT)

C:\EntityPerson>curl -i -X POST -H "Content-Type:application/rdf+xml" -T 
Marry.Smith.rdf "http://localhost:8080/entityhub/site/r2HR/entity";

 I get 

Unable to update an Entity 
file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf#Marry_Smith
 becuase it does already exists  and updateing existing is deactivated.  You 
might want to set the 'does already' parameter to TRUE in your Request

In my understanding, this message says that the ID of the entity is indeed

 ID= 
file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf#Marry_Smith
 

<<When you delete entities you need to parse the URIs as defined by the RDF 
data.
Isn't 
file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf#Marry_Smith
 
 the  URI parsed  from the RDF file content above?
 
What am I missing? Is it a matter of syntax maybe? I tried with "... 
Marry.Smith.rdf#Marry_Smith", "... Marry.Smith.rdf:Marry_Smith", "... 
Marry.Smith.rdf#Marry%20Smith", "... Marry.Smith.rdf"

Thank you,
Adrian

-----Message d'origine-----
De : Rupert Westenthaler [mailto:rupert.westentha...@gmail.com] 
Envoyé : June 27, 2015 6:29 AM
À : dev@stanbol.apache.org
Objet : Re: Entityhub Lookup : what ID to use?

Hi,

The ids of Entities are taken form the uploaded RDF data. If you parse an ID in 
the PUT or POST request it is just used to filter the RDF triples in the parsed 
RDF graph.

So e.g. if you file contains

    <http://www.example.org/my#entity1> rdf:type schema:Person .
    <http://www.example.org/my#entity1> rdfs:label "Person1" .
    <http://www.example.org/my#entity2> rdf:type schema:Person .
    <http://www.example.org/my#entity2> rdfs:label "Person2" .

If you just add those data (e.g. by a POST request to the entityhub/entity 
endpoint). Two entities my:entity1 and my:entity2 will be created.

If you POST the data with the id=http://www.example.org/my#entity1
parameter only the first two triples would be added to the Entityhub.

If you POST the data with the id=http://www.test.org/other#other
parameter no triples would be added as their is no match with the uploaded RDF 
data.

So in most cases it is sufficient to just upload the RDF files.

When you delete entities you need to parse the URIs as defined by the RDF data.

best
Rupert

On Fri, Jun 26, 2015 at 3:59 PM, Adrian Dinu <adr...@r-2.ca> wrote:
> Hi Rupert,
> Thank you for your reply.
> Adding "header_Accept=text/turtle" did not provide a result either, I 
> get
>
> No symbol found for 
> 'file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf#Marry_Smith'.
>
> I tried with the others  found at http://localhost:8080/enhance (REST 
> API link) application/json (JSON-LD) application/rdf+xml (RDF/XML) 
> application/rdf+json (RDF/JSON) text/turtle (Turtle) text/rdf+nt 
> (N-TRIPLES)
>
> with the same result.
>
> I thought that the ID  in the response received at the time when the entity 
> was created(by cURL), i.e.
>
>  HTTP/1.1 100 Continue
>  HTTP/1.1 201 Created
> Location:  
> http://localhost:8080/entityhub/site/r2HR/entity?id=file:///C:/Users/A
> cer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_Sm
> ith
>
> represents the ID I should use for   /entityhub/lookup and /entityhub/entity 
> DELETE  but apparently it does not.
>
> By looking at http://localhost:8080/entityhub/lookup I can see among 
> the instructions there
>
> Subresource  /lookup?id={uri}&create={create} and Request  GET 
> /lookup?id={uri}&create={create}
>
> What exactly is the {uri} I need to use in my case then?
>
> Best,
> Adrian
>
> -----Message d'origine-----
> De : Rupert Westenthaler [mailto:rupert.westentha...@gmail.com]
> Envoyé : June 26, 2015 10:08 AM
> À : dev@stanbol.apache.org
> Objet : Re: Entityhub Lookup : what ID to use?
>
> Hi,
>
> The Stanbol Entityhub does not have an RDF to HTML serializer. Because 
> of that it responds with
>
>     "The registered message body writers compatible with the MIME media type 
> are:
> text/html; charset=utf-8"
>
> If you send an RDF mime type (e.g. text/turtle) as Accept header it should 
> work just fine.
>
> Try to add "&header_Accept=text/turtle" to the end of your URL when 
> requesting an Entity via the browser.
>
> e.g.
>
> http://localhost:8080/entityhub/lookup?id=file:///C:/Users/Acer/Docume
> nts/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_Smith&header
> _Accept=text/turtle
>
> best
> Rupert
>
> On Thu, Jun 25, 2015 at 4:35 PM, Adrian Dinu <adr...@r-2.ca> wrote:
>> Hello,
>> I am not able to access my local named entities by ID.
>>
>> I create the entity Marry_Smith via cURL using this file
>> (Marry.Smith.rdf)
>> ---------------------------------------------------------------------
>> -
>> ------ <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF
>>   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
>>   xmlns:dc="http://purl.org/dc/elements/1.1/";
>>   xmlns:foaf="http://xmlns.com/foaf/0.1/";
>>   xml:base="file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/"
>>>
>>         <NamedIndividual rdf:about="Marry.Smith.rdf#Marry_Smith">
>>         <rdf:label>Marry Smith</rdf:label>
>>         <foaf:name>Marry Smith</foaf:name>
>>     </NamedIndividual>
>> </rdf:RDF>
>> ---------------------------------------------------------------------
>> -
>> ----------------
>> The response frum cURL is
>>
>> C:\Users\Acer\Documents\Semantic\Stanbol\EntityPerson>curl -i -X PUT -H 
>> "Content-Type:application/rdf+xml" -T Marry.Smith.rdf 
>> "http://localhost:8080/entityhub/site/r2HR/entity";
>> HTTP/1.1 100 Continue
>> HTTP/1.1 201 Created
>> Date: Thu, 25 Jun 2015 13:21:27 GMT
>> Location:
>> http://localhost:8080/entityhub/site/r2HR/entity?id=file:///C:/Users/
>> A 
>> cer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_S
>> m
>> ith
>> Accept: application/json
>> Content-Length: 0
>> Server: Jetty(7.x.y-SNAPSHOT)
>>
>> When I put
>> http://localhost:8080/entityhub/site/r2HR/entity?id=file:///C:/Users/
>> A 
>> cer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_S
>> m
>> ith
>> in the browser address box I get
>>
>> HTTP ERROR: 500
>> Problem accessing /entityhub/site/r2HR/entity. Reason:
>>     Internal Server Error
>>
>> and the following messages in the monitor window:
>>
>> 25-Jun-2015 11:03:25 AM 
>> com.sun.jersey.spi.container.ContainerResponse
>> write
>> SEVERE: The registered message body writers compatible with the MIME media 
>> type are:
>> text/html; charset=utf-8 ->
>>   org.apache.stanbol.commons.viewable.writer.impl.ViewableWriter
>>
>> org.apache.stanbol.commons.web.rdfviewable.writer.impl.LdViewableWrit
>> e
>> r
>> */* ->
>>   com.sun.jersey.core.impl.provider.entity.FormProvider
>>   com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
>>   com.sun.jersey.core.impl.provider.entity.StringProvider
>>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>>   com.sun.jersey.core.impl.provider.entity.FileProvider
>>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>>   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
>>   com.sun.jersey.core.impl.provider.entity.ReaderProvider
>>   com.sun.jersey.core.impl.provider.entity.DocumentProvider
>>   com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
>>   com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
>>   com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
>>   
>> com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Gener
>> al
>>
>> com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Gener
>> a
>> l
>>
>> 25-Jun-2015 11:03:25 AM 
>> com.sun.jersey.spi.container.ContainerResponse
>> logException
>> SEVERE: Mapped exception to response: 500 (Internal Server Error)
>> javax.ws.rs.WebApplicationException:
>> com.sun.jersey.api.MessageException: A message body writer for Java class 
>> org.apache.stanbol.entityhub.core.model.EntityImpl, and Java type cla ss 
>> org.apache.stanbol.entityhub.core.model.EntityImpl, and MIME media type 
>> text/html; charset=utf-8 was not found
>>         at 
>> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
>>         at 
>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1448)
>>         at 
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
>>         at 
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
>>         at 
>> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
>>         at 
>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
>>         at 
>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>         at 
>> org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
>>         at 
>> org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:78)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at 
>> org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.doFilter(QueryHeadersFilter.java:75)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at 
>> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilterHttp(ResourceServingFilter.java:148)
>>         at 
>> org.apache.stanbol.commons.web.resources.ResourceServingFilter.doFilter(ResourceServingFilter.java:91)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at 
>> org.apache.stanbol.commons.security.auth.AuthenticatingFilter$1.run(AuthenticatingFilter.java:163)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
>>         at 
>> org.apache.stanbol.commons.security.auth.AuthenticatingFilter.doFilter(AuthenticatingFilter.java:159)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
>>         at 
>> org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
>>         at 
>> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
>>         at 
>> org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>         at 
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:654)
>>         at 
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
>>         at 
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
>>         at 
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
>>         at 
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
>>         at 
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
>>         at 
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
>>         at 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>>         at 
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
>>         at 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>>         at org.eclipse.jetty.server.Server.handle(Server.java:369)
>>         at 
>> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
>>         at 
>> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:933)
>>         at 
>> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:995)
>>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
>>         at 
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
>>         at 
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>>         at 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
>>         at 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
>>         at 
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>>         at 
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>>         at java.lang.Thread.run(Unknown Source) Caused by:
>> com.sun.jersey.api.MessageException: A message body writer for Java 
>> class org.apache.stanbol.entityhub.core.model.EntityImpl, and Java type 
>> class org.apache.stanbol.enti tyhub.core.model.EntityImpl, and MIME media 
>> type text/html; charset=utf-8 was not found
>>         ... 61 more
>>
>> Is
>>
>> file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.S
>> m
>> ith.rdf%23Marry_Smith
>>
>> the ID that Stanbol uses for this entity?
>>
>> Neither Entityhub Lookup does not work with it :
>>
>> http://localhost:8080/entityhub/lookup?id=file:///C:/Users/Acer/Docum
>> e nts/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf%23Marry_Smith
>>
>> produces
>> "No symbol found for 
>> 'file:///C:/Users/Acer/Documents/Semantic/Stanbol/EntityPerson/Marry.Smith.rdf#Marry_Smith'.
>>  "
>>
>>
>> Can anybody explain to me please what is the actual ID I should use?
>>
>> Thank you,
>> Adrian
>>
>>
>
>
>
> --
> | Rupert Westenthaler             rupert.westentha...@gmail.com
> | Bodenlehenstraße 11                              ++43-699-11108907
> | A-5500 Bischofshofen
> | REDLINK.CO 
> ..........................................................................
> | http://redlink.co/
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2014.0.4813 / Virus Database: 4365/10100 - Release Date: 
> 06/26/15
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2014.0.4800 / Virus Database: 4365/10052 - Release Date: 06/19/15 
> Internal Virus Database is out of date.
>



-- 
| Rupert Westenthaler             rupert.westentha...@gmail.com
| Bodenlehenstraße 11                              ++43-699-11108907
| A-5500 Bischofshofen
| REDLINK.CO 
..........................................................................
| http://redlink.co/



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4813 / Virus Database: 4365/10122 - Release Date: 06/29/15


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4813 / Virus Database: 4365/10122 - Release Date: 06/29/15

Reply via email to