You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by florent andré <fl...@4sengines.com> on 2011/07/23 20:37:08 UTC

entityhub/query endpoint not still running ?

Hi Rupert, all

I just update stanbol to the last version and I figure out that 
entityhub/query don't answer to my previously running requests.
Do this endpoint don't still like me ? :)

So I run the full launcher, and restart from the online documentation 
(in entityhub enpoint / rest api ) and try examples.

so I, for example :
-------
$ curl -X POST -H "Content-Type:application/json" --data 
"@fieldQueryjson" http://localhost:8080/entityhub/query
-------

Where
--------
@fieldQueryjson
{
     "selected": [
         "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
         "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
     "offset": "0",
     "limit": "3",
     "constraints": [
{
     "type": "value",
     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
     "value": "Paris",
}
	
	]
}
---------

Answer :
---------
{
     "query": {
         "selected": [
             "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
             "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
         ],
         "constraints": [{
             "type": "value",
             "value": "Paris",
             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
         }],
         "limit": 3
     },
     "results": []
----------

Others examples do the same.

Do I miss something ?

Another point :

I see that for constraints type:text, the field patternType is now 
mandatory... even if documentation says that default value is to "none" 
and in previous version we can miss this property without problems.

When no pattern type is in the request, message is :
Constraint parsing Errors:

Illegal value for field 'patternType'.
Supported values are: [none, regex, wildcard]
Parsed Constraint:
{
     "type": "text",
     "languages": ["de"],
     "text": "Frankf*",
     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
}

Thanks
++

Re: entityhub/query endpoint not still running ?

Posted by Rupert Westenthaler <ru...@gmail.com>.
On Tue, Jul 26, 2011 at 4:26 PM, Florent André <fl...@apache.org> wrote:
> Bigs thanks Rupert for this detailed explanation and your time.
>
> It really clear now.
> In fact I was confuse by the "local" term and imported (cached in fact)
> referenced sites (I think this lasts one are the "locals").
>
> Investigate documentation with this insight this bring me to some
> thoughts/questions. Stop me if I'm wrong :
>
> - entityhub/lookup allow to search entities in local and in referenced site.
> It's the unique entry point when we want request "home made" symbols and
> referenced entities.
>
Currently there is no way to search the local and all referenced
sites. Basically lookup does exactly that, but it would also import an
entity found on an referenced site therefore it is not really a way to
search only.
However if you would need this feature just write a feature request.
Maybe /lookup should only search and one should add an /import?

> - entityhub/mapping/{entity|symbol} : make the link between local and
> referenced things [ ha ! a symbol here ! :) ]
>

Exactly. Mappings are created when you import an entity. In future it
is also planed to automatically detect them based on owl:sameAs links
to other entities present on referenced sites but that is currently
not implemented and I do not have it on my immediately TODO list.
The "symbol" is still there because I was not able to find a good
name. Maybe It would be possible to remove both mapping/entity and
mapping/symbol and just go with /mapping.

> - entityhub/entity perform CRUD operation for adding entities to the local
> repository.
>

Yes this is the Idea. I will also write integration tests for that in
the coming days

> About the creation of local entities, documentation just speak about the id
> parameter.

Basically you parse an RDF graph in the POST (create) and PUT (update)
requests to /entity. Such an RDF graph can contain triples about many
resources. Think about parsing the RDF data of an whole thesaurus.
If no id parameter is parsed, than all the resources used as subjects
within triples in the parsed RDF graph will be created as Entities. In
case of the thesaurus all concepts (skos:Concept) and the resource for
the thesaurus itself (skos:ConceptScheme) would be created as
entities.
If you parse the URI of a single concept as id, than only this Entity
(all triples with this URI as subject) would be imported and all the
triples would get ignored.

> There is a way to add any kind of relations to this entities (like
> skos:definition) ? It's planned ?

Updating an entity works like this:

* GET the entity
* add the data you want
* PUT the entity with the additional data.

best
Rupert Westenthaler

-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: entityhub/query endpoint not still running ?

Posted by Florent André <fl...@apache.org>.
Bigs thanks Rupert for this detailed explanation and your time.

It really clear now.
In fact I was confuse by the "local" term and imported (cached in fact) 
referenced sites (I think this lasts one are the "locals").

Investigate documentation with this insight this bring me to some 
thoughts/questions. Stop me if I'm wrong :

- entityhub/lookup allow to search entities in local and in referenced site.
It's the unique entry point when we want request "home made" symbols and 
referenced entities.

- entityhub/mapping/{entity|symbol} : make the link between local and 
referenced things [ ha ! a symbol here ! :) ]

- entityhub/entity perform CRUD operation for adding entities to the 
local repository.

About the creation of local entities, documentation just speak about the 
id parameter.
There is a way to add any kind of relations to this entities (like 
skos:definition) ? It's planned ?


Really promising and so interesting !
Thanks Rupert.
Have a good day.


On 07/26/2011 06:16 AM, Rupert Westenthaler wrote:
> Hi
>
> On Tue, Jul 26, 2011 at 12:13 AM, Florent André<fl...@apache.org>  wrote:
>> OK ! I got it !
>>
>> I fact, I used endpoint :
>> - entityhub/query
>>
>> without the *sites* sub-resource (entityhub/sites/query).
>> With *sites* sub-resource it works well.
>>
>
> 1. entityhub/query: Searches local Entities (created via POST
> entityhub/entity or imported from referenced sites via GET
> entityhub/lookup?id={id}&create=true). It will not query for entities
> of any referenced site!
>
> 2. entityhub/sites/query: Searches for Entities on ALL referenced
> sites. Basically the query you send is forwarded to all referenced
> sites and the results of the different sites are collected.
>
> 3. entityhub/site/{site-id}/query: Searches for Entities on the
> referenced site with the id {site-id}.
>
>
>> And in fact, _without_ sites what I see is :
>> - entityhub/query : send empty results
>
> Thats expected as long as you have not created or imported (via
> lookup) entities to the entityhub.
>
>> - entityhub/find : send 404.
>>
>
> This service only supports simple label based searches such as
>
> GET entityhub/find?name=Munic*&language=en&limit=10&offset=10
>
>
>> In documentation entityhub/query is mark as local managed entities...
>> DBpedia import is in local right ? So I may have results for this request...
>> or I get wrong somewhere ?
>>
> DBPedia as a referenced site that is locally cached. The Entities are
> still in the governace of DBPedia (or Wikipedia). There is no way to
> make local changes to such entities via the Entityhub.
> Entities within entityhub/entity are locally managed. The Entityhub
> allows to create/update and delete such entities. One can also import
> Entities from any referenced site to entityhub/entity. This operation
> will however create an own URI for the imported Entity and create a
> mapping from the new locally managed Entity with the origin (see
> entityhub/lookup for details)
>
>> I update integration tests with /sites/.
>>
>> I just actually test 2 requests [1], and it will be cool to integrate your
>> documentation's query. Do you have a pointer in mind ?
>>
> As soon I have completed my work on STANBOL-298 I will continue to work on this.
>
> BTW I changed STANBOL-299 as sub-task to STANBOL-62.
>
> best
> Rupert
>
>> Thanks !
>>
>> [1]
>> https://svn.apache.org/repos/asf/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/EntityHubTest.java
>>
>> On 07/25/2011 11:16 PM, Rupert Westenthaler wrote:
>>>
>>> Hi
>>>
>>> On Mon, Jul 25, 2011 at 7:52 PM, Florent André<fl...@apache.org>    wrote:
>>>>
>>>> Rupert,
>>>>
>>>> Thanks for your answer.
>>>>
>>>> I have made modifications to my requests following your advice (I hope
>>>> well), but I don't still get results.
>>>>
>>> Do you query against the dbpedia.org dataset?
>>> If so, could you please post the queries you have problems with.
>>>
>>>> I order to automat (and train myself) I wrote a first little integration
>>>> test for entityhub.
>>>> For now it's only test value and text query on entityhub/query endpoint.
>>>>
>>> While working on STANBOL-298 I made several test queries - for the
>>> documentation - this queries would be also nice to use for unit tests.
>>> In order to test such queries I also included additional fields
>>> (geo:lat, geo:long, geo:alt, dbpedia-ont:totalPopulation ...) in the
>>> default data index. This index would than also allow to test most of
>>> the features of the field query against the default dataset.
>>>
>>>> I also add a test on /symbol endpoint, even if it's seems me to remember
>>>> that it's outdated... but it's still in documentation.
>>>>
>>> the /symbol endpoint is no longer around but was moved to /entity
>>> about a month ago. So if you still have a /symbol than you should
>>> check if you run the current version.
>>>
>>>> For now, this integration test pass on wrong value because I don't want
>>>> to
>>>> break the build for this... but when problem solved I will manage
>>>> accurate
>>>> tests.
>>>>
>>> Thx for starting this.
>>>
>>> best
>>> Rupert
>>>
>>>> Cheers.
>>>>
>>>>
>>>> On 07/25/2011 06:34 AM, Rupert Westenthaler wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> On Sat, Jul 23, 2011 at 8:37 PM, florent andré
>>>>> <fl...@4sengines.com>      wrote:
>>>>>>
>>>>>> Hi Rupert, all
>>>>>>
>>>>>> I just update stanbol to the last version and I figure out that
>>>>>> entityhub/query don't answer to my previously running requests.
>>>>>> Do this endpoint don't still like me ? :)
>>>>>>
>>>>>> So I run the full launcher, and restart from the online documentation
>>>>>> (in
>>>>>> entityhub enpoint / rest api ) and try examples.
>>>>>>
>>>>>> so I, for example :
>>>>>> -------
>>>>>> $ curl -X POST -H "Content-Type:application/json" --data
>>>>>> "@fieldQueryjson"
>>>>>> http://localhost:8080/entityhub/query
>>>>>> -------
>>>>>>
>>>>>> Where
>>>>>> --------
>>>>>> @fieldQueryjson
>>>>>> {
>>>>>>     "selected": [
>>>>>>         "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>>>         "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>>>>>>     "offset": "0",
>>>>>>     "limit": "3",
>>>>>>     "constraints": [
>>>>>> {
>>>>>>     "type": "value",
>>>>>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>>>     "value": "Paris",
>>>>>> }
>>>>>>
>>>>>>         ]
>>>>>> }
>>>>>> ---------
>>>>>>
>>>>>> Answer :
>>>>>> ---------
>>>>>> {
>>>>>>     "query": {
>>>>>>         "selected": [
>>>>>>             "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>>>>>>             "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>>>         ],
>>>>>>         "constraints": [{
>>>>>>             "type": "value",
>>>>>>             "value": "Paris",
>>>>>>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>>>         }],
>>>>>>         "limit": 3
>>>>>>     },
>>>>>>     "results": []
>>>>>> ----------
>>>>>>
>>>>>
>>>>> This result is expected for the DBPedia dataset because value
>>>>> constraints do map parsed values to the data type "xsd:String" however
>>>>> the Entityhub uses "entityhub:text" for natural language values. I
>>>>> will update the example of the online help to use a more typical
>>>>> example. I will also add a list of supported data types.
>>>>>
>>>>> The get the results expected results you would need to use the
>>>>> following constraint
>>>>>
>>>>>         "constraints": [{
>>>>>             "type": "value",
>>>>>             "value": "Paris",
>>>>>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>>             "dataTypes":
>>>>> ["http://www.iks-project.eu/ontology/rick/model/text"]
>>>>>         }],
>>>>>
>>>>> In addition I will implement support for "prefix:localname" so that it
>>>>> is possible to use "entityhub:text" instead of the full URL
>>>>>
>>>>>> Others examples do the same.
>>>>>>
>>>>>> Do I miss something ?
>>>>>>
>>>>>> Another point :
>>>>>>
>>>>>> I see that for constraints type:text, the field patternType is now
>>>>>> mandatory... even if documentation says that default value is to "none"
>>>>>> and
>>>>>> in previous version we can miss this property without problems.
>>>>>>
>>>>>> When no pattern type is in the request, message is :
>>>>>> Constraint parsing Errors:
>>>>>>
>>>>>> Illegal value for field 'patternType'.
>>>>>> Supported values are: [none, regex, wildcard]
>>>>>> Parsed Constraint:
>>>>>> {
>>>>>>     "type": "text",
>>>>>>     "languages": ["de"],
>>>>>>     "text": "Frankf*",
>>>>>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>>> }
>>>>>>
>>>>>
>>>>> The reason for that is that "JSONObject.optString("patternType") now
>>>>> returns an empty string if the property is not present. However the
>>>>> code expects NULL to be returned in such cases.
>>>>>
>>>>> Because opt***(...) methods are used on several places in different
>>>>> places I will need to review all such use ages.
>>>>>
>>>>> I hope I can provide a patch for this later today. In the meantime
>>>>> please parse a valid patternType.
>>>>>
>>>>> BTW:
>>>>>
>>>>>>     "text": "Frankf*",
>>>>>
>>>>> will not return any values for pattern type 'none'
>>>>>
>>>>>
>>>>>> Thanks
>>>>>> ++
>>>>>>
>>>>>
>>>>> Thanks for the report!
>>>>>
>>>>> best
>>>>> Rupert Westenthaler
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>

Re: entityhub/query endpoint not still running ?

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi

On Tue, Jul 26, 2011 at 12:13 AM, Florent André <fl...@apache.org> wrote:
> OK ! I got it !
>
> I fact, I used endpoint :
> - entityhub/query
>
> without the *sites* sub-resource (entityhub/sites/query).
> With *sites* sub-resource it works well.
>

1. entityhub/query: Searches local Entities (created via POST
entityhub/entity or imported from referenced sites via GET
entityhub/lookup?id={id}&create=true). It will not query for entities
of any referenced site!

2. entityhub/sites/query: Searches for Entities on ALL referenced
sites. Basically the query you send is forwarded to all referenced
sites and the results of the different sites are collected.

3. entityhub/site/{site-id}/query: Searches for Entities on the
referenced site with the id {site-id}.


> And in fact, _without_ sites what I see is :
> - entityhub/query : send empty results

Thats expected as long as you have not created or imported (via
lookup) entities to the entityhub.

> - entityhub/find : send 404.
>

This service only supports simple label based searches such as

GET entityhub/find?name=Munic*&language=en&limit=10&offset=10


> In documentation entityhub/query is mark as local managed entities...
> DBpedia import is in local right ? So I may have results for this request...
> or I get wrong somewhere ?
>
DBPedia as a referenced site that is locally cached. The Entities are
still in the governace of DBPedia (or Wikipedia). There is no way to
make local changes to such entities via the Entityhub.
Entities within entityhub/entity are locally managed. The Entityhub
allows to create/update and delete such entities. One can also import
Entities from any referenced site to entityhub/entity. This operation
will however create an own URI for the imported Entity and create a
mapping from the new locally managed Entity with the origin (see
entityhub/lookup for details)

> I update integration tests with /sites/.
>
> I just actually test 2 requests [1], and it will be cool to integrate your
> documentation's query. Do you have a pointer in mind ?
>
As soon I have completed my work on STANBOL-298 I will continue to work on this.

BTW I changed STANBOL-299 as sub-task to STANBOL-62.

best
Rupert

> Thanks !
>
> [1]
> https://svn.apache.org/repos/asf/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/EntityHubTest.java
>
> On 07/25/2011 11:16 PM, Rupert Westenthaler wrote:
>>
>> Hi
>>
>> On Mon, Jul 25, 2011 at 7:52 PM, Florent André<fl...@apache.org>  wrote:
>>>
>>> Rupert,
>>>
>>> Thanks for your answer.
>>>
>>> I have made modifications to my requests following your advice (I hope
>>> well), but I don't still get results.
>>>
>> Do you query against the dbpedia.org dataset?
>> If so, could you please post the queries you have problems with.
>>
>>> I order to automat (and train myself) I wrote a first little integration
>>> test for entityhub.
>>> For now it's only test value and text query on entityhub/query endpoint.
>>>
>> While working on STANBOL-298 I made several test queries - for the
>> documentation - this queries would be also nice to use for unit tests.
>> In order to test such queries I also included additional fields
>> (geo:lat, geo:long, geo:alt, dbpedia-ont:totalPopulation ...) in the
>> default data index. This index would than also allow to test most of
>> the features of the field query against the default dataset.
>>
>>> I also add a test on /symbol endpoint, even if it's seems me to remember
>>> that it's outdated... but it's still in documentation.
>>>
>> the /symbol endpoint is no longer around but was moved to /entity
>> about a month ago. So if you still have a /symbol than you should
>> check if you run the current version.
>>
>>> For now, this integration test pass on wrong value because I don't want
>>> to
>>> break the build for this... but when problem solved I will manage
>>> accurate
>>> tests.
>>>
>> Thx for starting this.
>>
>> best
>> Rupert
>>
>>> Cheers.
>>>
>>>
>>> On 07/25/2011 06:34 AM, Rupert Westenthaler wrote:
>>>>
>>>> Hi
>>>>
>>>> On Sat, Jul 23, 2011 at 8:37 PM, florent andré
>>>> <fl...@4sengines.com>    wrote:
>>>>>
>>>>> Hi Rupert, all
>>>>>
>>>>> I just update stanbol to the last version and I figure out that
>>>>> entityhub/query don't answer to my previously running requests.
>>>>> Do this endpoint don't still like me ? :)
>>>>>
>>>>> So I run the full launcher, and restart from the online documentation
>>>>> (in
>>>>> entityhub enpoint / rest api ) and try examples.
>>>>>
>>>>> so I, for example :
>>>>> -------
>>>>> $ curl -X POST -H "Content-Type:application/json" --data
>>>>> "@fieldQueryjson"
>>>>> http://localhost:8080/entityhub/query
>>>>> -------
>>>>>
>>>>> Where
>>>>> --------
>>>>> @fieldQueryjson
>>>>> {
>>>>>    "selected": [
>>>>>        "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>>        "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>>>>>    "offset": "0",
>>>>>    "limit": "3",
>>>>>    "constraints": [
>>>>> {
>>>>>    "type": "value",
>>>>>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>>    "value": "Paris",
>>>>> }
>>>>>
>>>>>        ]
>>>>> }
>>>>> ---------
>>>>>
>>>>> Answer :
>>>>> ---------
>>>>> {
>>>>>    "query": {
>>>>>        "selected": [
>>>>>            "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>>>>>            "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>>        ],
>>>>>        "constraints": [{
>>>>>            "type": "value",
>>>>>            "value": "Paris",
>>>>>            "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>>        }],
>>>>>        "limit": 3
>>>>>    },
>>>>>    "results": []
>>>>> ----------
>>>>>
>>>>
>>>> This result is expected for the DBPedia dataset because value
>>>> constraints do map parsed values to the data type "xsd:String" however
>>>> the Entityhub uses "entityhub:text" for natural language values. I
>>>> will update the example of the online help to use a more typical
>>>> example. I will also add a list of supported data types.
>>>>
>>>> The get the results expected results you would need to use the
>>>> following constraint
>>>>
>>>>        "constraints": [{
>>>>            "type": "value",
>>>>            "value": "Paris",
>>>>            "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>            "dataTypes":
>>>> ["http://www.iks-project.eu/ontology/rick/model/text"]
>>>>        }],
>>>>
>>>> In addition I will implement support for "prefix:localname" so that it
>>>> is possible to use "entityhub:text" instead of the full URL
>>>>
>>>>> Others examples do the same.
>>>>>
>>>>> Do I miss something ?
>>>>>
>>>>> Another point :
>>>>>
>>>>> I see that for constraints type:text, the field patternType is now
>>>>> mandatory... even if documentation says that default value is to "none"
>>>>> and
>>>>> in previous version we can miss this property without problems.
>>>>>
>>>>> When no pattern type is in the request, message is :
>>>>> Constraint parsing Errors:
>>>>>
>>>>> Illegal value for field 'patternType'.
>>>>> Supported values are: [none, regex, wildcard]
>>>>> Parsed Constraint:
>>>>> {
>>>>>    "type": "text",
>>>>>    "languages": ["de"],
>>>>>    "text": "Frankf*",
>>>>>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>> }
>>>>>
>>>>
>>>> The reason for that is that "JSONObject.optString("patternType") now
>>>> returns an empty string if the property is not present. However the
>>>> code expects NULL to be returned in such cases.
>>>>
>>>> Because opt***(...) methods are used on several places in different
>>>> places I will need to review all such use ages.
>>>>
>>>> I hope I can provide a patch for this later today. In the meantime
>>>> please parse a valid patternType.
>>>>
>>>> BTW:
>>>>
>>>>>    "text": "Frankf*",
>>>>
>>>> will not return any values for pattern type 'none'
>>>>
>>>>
>>>>> Thanks
>>>>> ++
>>>>>
>>>>
>>>> Thanks for the report!
>>>>
>>>> best
>>>> Rupert Westenthaler
>>>>
>>>>
>>>
>>
>>
>>
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: entityhub/query endpoint not still running ?

Posted by Florent André <fl...@apache.org>.
OK ! I got it !

I fact, I used endpoint :
- entityhub/query

without the *sites* sub-resource (entityhub/sites/query).
With *sites* sub-resource it works well.

And in fact, _without_ sites what I see is :
- entityhub/query : send empty results
- entityhub/find : send 404.

In documentation entityhub/query is mark as local managed entities... 
DBpedia import is in local right ? So I may have results for this 
request... or I get wrong somewhere ?

I update integration tests with /sites/.

I just actually test 2 requests [1], and it will be cool to integrate 
your documentation's query. Do you have a pointer in mind ?

Thanks !

[1] 
https://svn.apache.org/repos/asf/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/entityhub/it/EntityHubTest.java

On 07/25/2011 11:16 PM, Rupert Westenthaler wrote:
> Hi
>
> On Mon, Jul 25, 2011 at 7:52 PM, Florent André<fl...@apache.org>  wrote:
>> Rupert,
>>
>> Thanks for your answer.
>>
>> I have made modifications to my requests following your advice (I hope
>> well), but I don't still get results.
>>
> Do you query against the dbpedia.org dataset?
> If so, could you please post the queries you have problems with.
>
>> I order to automat (and train myself) I wrote a first little integration
>> test for entityhub.
>> For now it's only test value and text query on entityhub/query endpoint.
>>
> While working on STANBOL-298 I made several test queries - for the
> documentation - this queries would be also nice to use for unit tests.
> In order to test such queries I also included additional fields
> (geo:lat, geo:long, geo:alt, dbpedia-ont:totalPopulation ...) in the
> default data index. This index would than also allow to test most of
> the features of the field query against the default dataset.
>
>> I also add a test on /symbol endpoint, even if it's seems me to remember
>> that it's outdated... but it's still in documentation.
>>
> the /symbol endpoint is no longer around but was moved to /entity
> about a month ago. So if you still have a /symbol than you should
> check if you run the current version.
>
>> For now, this integration test pass on wrong value because I don't want to
>> break the build for this... but when problem solved I will manage accurate
>> tests.
>>
> Thx for starting this.
>
> best
> Rupert
>
>> Cheers.
>>
>>
>> On 07/25/2011 06:34 AM, Rupert Westenthaler wrote:
>>>
>>> Hi
>>>
>>> On Sat, Jul 23, 2011 at 8:37 PM, florent andré
>>> <fl...@4sengines.com>    wrote:
>>>>
>>>> Hi Rupert, all
>>>>
>>>> I just update stanbol to the last version and I figure out that
>>>> entityhub/query don't answer to my previously running requests.
>>>> Do this endpoint don't still like me ? :)
>>>>
>>>> So I run the full launcher, and restart from the online documentation (in
>>>> entityhub enpoint / rest api ) and try examples.
>>>>
>>>> so I, for example :
>>>> -------
>>>> $ curl -X POST -H "Content-Type:application/json" --data
>>>> "@fieldQueryjson"
>>>> http://localhost:8080/entityhub/query
>>>> -------
>>>>
>>>> Where
>>>> --------
>>>> @fieldQueryjson
>>>> {
>>>>     "selected": [
>>>>         "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>         "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>>>>     "offset": "0",
>>>>     "limit": "3",
>>>>     "constraints": [
>>>> {
>>>>     "type": "value",
>>>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>>     "value": "Paris",
>>>> }
>>>>
>>>>         ]
>>>> }
>>>> ---------
>>>>
>>>> Answer :
>>>> ---------
>>>> {
>>>>     "query": {
>>>>         "selected": [
>>>>             "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>>>>             "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>         ],
>>>>         "constraints": [{
>>>>             "type": "value",
>>>>             "value": "Paris",
>>>>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>>         }],
>>>>         "limit": 3
>>>>     },
>>>>     "results": []
>>>> ----------
>>>>
>>>
>>> This result is expected for the DBPedia dataset because value
>>> constraints do map parsed values to the data type "xsd:String" however
>>> the Entityhub uses "entityhub:text" for natural language values. I
>>> will update the example of the online help to use a more typical
>>> example. I will also add a list of supported data types.
>>>
>>> The get the results expected results you would need to use the
>>> following constraint
>>>
>>>         "constraints": [{
>>>             "type": "value",
>>>             "value": "Paris",
>>>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>             "dataTypes":
>>> ["http://www.iks-project.eu/ontology/rick/model/text"]
>>>         }],
>>>
>>> In addition I will implement support for "prefix:localname" so that it
>>> is possible to use "entityhub:text" instead of the full URL
>>>
>>>> Others examples do the same.
>>>>
>>>> Do I miss something ?
>>>>
>>>> Another point :
>>>>
>>>> I see that for constraints type:text, the field patternType is now
>>>> mandatory... even if documentation says that default value is to "none"
>>>> and
>>>> in previous version we can miss this property without problems.
>>>>
>>>> When no pattern type is in the request, message is :
>>>> Constraint parsing Errors:
>>>>
>>>> Illegal value for field 'patternType'.
>>>> Supported values are: [none, regex, wildcard]
>>>> Parsed Constraint:
>>>> {
>>>>     "type": "text",
>>>>     "languages": ["de"],
>>>>     "text": "Frankf*",
>>>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>> }
>>>>
>>>
>>> The reason for that is that "JSONObject.optString("patternType") now
>>> returns an empty string if the property is not present. However the
>>> code expects NULL to be returned in such cases.
>>>
>>> Because opt***(...) methods are used on several places in different
>>> places I will need to review all such use ages.
>>>
>>> I hope I can provide a patch for this later today. In the meantime
>>> please parse a valid patternType.
>>>
>>> BTW:
>>>
>>>>     "text": "Frankf*",
>>>
>>> will not return any values for pattern type 'none'
>>>
>>>
>>>> Thanks
>>>> ++
>>>>
>>>
>>> Thanks for the report!
>>>
>>> best
>>> Rupert Westenthaler
>>>
>>>
>>
>
>
>

Re: entityhub/query endpoint not still running ?

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi

On Mon, Jul 25, 2011 at 7:52 PM, Florent André <fl...@apache.org> wrote:
> Rupert,
>
> Thanks for your answer.
>
> I have made modifications to my requests following your advice (I hope
> well), but I don't still get results.
>
Do you query against the dbpedia.org dataset?
If so, could you please post the queries you have problems with.

> I order to automat (and train myself) I wrote a first little integration
> test for entityhub.
> For now it's only test value and text query on entityhub/query endpoint.
>
While working on STANBOL-298 I made several test queries - for the
documentation - this queries would be also nice to use for unit tests.
In order to test such queries I also included additional fields
(geo:lat, geo:long, geo:alt, dbpedia-ont:totalPopulation ...) in the
default data index. This index would than also allow to test most of
the features of the field query against the default dataset.

> I also add a test on /symbol endpoint, even if it's seems me to remember
> that it's outdated... but it's still in documentation.
>
the /symbol endpoint is no longer around but was moved to /entity
about a month ago. So if you still have a /symbol than you should
check if you run the current version.

> For now, this integration test pass on wrong value because I don't want to
> break the build for this... but when problem solved I will manage accurate
> tests.
>
Thx for starting this.

best
Rupert

> Cheers.
>
>
> On 07/25/2011 06:34 AM, Rupert Westenthaler wrote:
>>
>> Hi
>>
>> On Sat, Jul 23, 2011 at 8:37 PM, florent andré
>> <fl...@4sengines.com>  wrote:
>>>
>>> Hi Rupert, all
>>>
>>> I just update stanbol to the last version and I figure out that
>>> entityhub/query don't answer to my previously running requests.
>>> Do this endpoint don't still like me ? :)
>>>
>>> So I run the full launcher, and restart from the online documentation (in
>>> entityhub enpoint / rest api ) and try examples.
>>>
>>> so I, for example :
>>> -------
>>> $ curl -X POST -H "Content-Type:application/json" --data
>>> "@fieldQueryjson"
>>> http://localhost:8080/entityhub/query
>>> -------
>>>
>>> Where
>>> --------
>>> @fieldQueryjson
>>> {
>>>    "selected": [
>>>        "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>        "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>>>    "offset": "0",
>>>    "limit": "3",
>>>    "constraints": [
>>> {
>>>    "type": "value",
>>>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>>    "value": "Paris",
>>> }
>>>
>>>        ]
>>> }
>>> ---------
>>>
>>> Answer :
>>> ---------
>>> {
>>>    "query": {
>>>        "selected": [
>>>            "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>>>            "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>        ],
>>>        "constraints": [{
>>>            "type": "value",
>>>            "value": "Paris",
>>>            "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>>        }],
>>>        "limit": 3
>>>    },
>>>    "results": []
>>> ----------
>>>
>>
>> This result is expected for the DBPedia dataset because value
>> constraints do map parsed values to the data type "xsd:String" however
>> the Entityhub uses "entityhub:text" for natural language values. I
>> will update the example of the online help to use a more typical
>> example. I will also add a list of supported data types.
>>
>> The get the results expected results you would need to use the
>> following constraint
>>
>>        "constraints": [{
>>            "type": "value",
>>            "value": "Paris",
>>            "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>            "dataTypes":
>> ["http://www.iks-project.eu/ontology/rick/model/text"]
>>        }],
>>
>> In addition I will implement support for "prefix:localname" so that it
>> is possible to use "entityhub:text" instead of the full URL
>>
>>> Others examples do the same.
>>>
>>> Do I miss something ?
>>>
>>> Another point :
>>>
>>> I see that for constraints type:text, the field patternType is now
>>> mandatory... even if documentation says that default value is to "none"
>>> and
>>> in previous version we can miss this property without problems.
>>>
>>> When no pattern type is in the request, message is :
>>> Constraint parsing Errors:
>>>
>>> Illegal value for field 'patternType'.
>>> Supported values are: [none, regex, wildcard]
>>> Parsed Constraint:
>>> {
>>>    "type": "text",
>>>    "languages": ["de"],
>>>    "text": "Frankf*",
>>>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>> }
>>>
>>
>> The reason for that is that "JSONObject.optString("patternType") now
>> returns an empty string if the property is not present. However the
>> code expects NULL to be returned in such cases.
>>
>> Because opt***(...) methods are used on several places in different
>> places I will need to review all such use ages.
>>
>> I hope I can provide a patch for this later today. In the meantime
>> please parse a valid patternType.
>>
>> BTW:
>>
>>>    "text": "Frankf*",
>>
>> will not return any values for pattern type 'none'
>>
>>
>>> Thanks
>>> ++
>>>
>>
>> Thanks for the report!
>>
>> best
>> Rupert Westenthaler
>>
>>
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: entityhub/query endpoint not still running ?

Posted by Florent André <fl...@apache.org>.
Rupert,

Thanks for your answer.

I have made modifications to my requests following your advice (I hope 
well), but I don't still get results.

I order to automat (and train myself) I wrote a first little integration 
test for entityhub.
For now it's only test value and text query on entityhub/query endpoint.

I also add a test on /symbol endpoint, even if it's seems me to remember 
that it's outdated... but it's still in documentation.

For now, this integration test pass on wrong value because I don't want 
to break the build for this... but when problem solved I will manage 
accurate tests.

Cheers.


On 07/25/2011 06:34 AM, Rupert Westenthaler wrote:
> Hi
>
> On Sat, Jul 23, 2011 at 8:37 PM, florent andré
> <fl...@4sengines.com>  wrote:
>> Hi Rupert, all
>>
>> I just update stanbol to the last version and I figure out that
>> entityhub/query don't answer to my previously running requests.
>> Do this endpoint don't still like me ? :)
>>
>> So I run the full launcher, and restart from the online documentation (in
>> entityhub enpoint / rest api ) and try examples.
>>
>> so I, for example :
>> -------
>> $ curl -X POST -H "Content-Type:application/json" --data "@fieldQueryjson"
>> http://localhost:8080/entityhub/query
>> -------
>>
>> Where
>> --------
>> @fieldQueryjson
>> {
>>     "selected": [
>>         "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>         "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>>     "offset": "0",
>>     "limit": "3",
>>     "constraints": [
>> {
>>     "type": "value",
>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>>     "value": "Paris",
>> }
>>
>>         ]
>> }
>> ---------
>>
>> Answer :
>> ---------
>> {
>>     "query": {
>>         "selected": [
>>             "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>>             "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>         ],
>>         "constraints": [{
>>             "type": "value",
>>             "value": "Paris",
>>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>>         }],
>>         "limit": 3
>>     },
>>     "results": []
>> ----------
>>
>
> This result is expected for the DBPedia dataset because value
> constraints do map parsed values to the data type "xsd:String" however
> the Entityhub uses "entityhub:text" for natural language values. I
> will update the example of the online help to use a more typical
> example. I will also add a list of supported data types.
>
> The get the results expected results you would need to use the
> following constraint
>
>         "constraints": [{
>             "type": "value",
>             "value": "Paris",
>             "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>             "dataTypes": ["http://www.iks-project.eu/ontology/rick/model/text"]
>         }],
>
> In addition I will implement support for "prefix:localname" so that it
> is possible to use "entityhub:text" instead of the full URL
>
>> Others examples do the same.
>>
>> Do I miss something ?
>>
>> Another point :
>>
>> I see that for constraints type:text, the field patternType is now
>> mandatory... even if documentation says that default value is to "none" and
>> in previous version we can miss this property without problems.
>>
>> When no pattern type is in the request, message is :
>> Constraint parsing Errors:
>>
>> Illegal value for field 'patternType'.
>> Supported values are: [none, regex, wildcard]
>> Parsed Constraint:
>> {
>>     "type": "text",
>>     "languages": ["de"],
>>     "text": "Frankf*",
>>     "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>> }
>>
>
> The reason for that is that "JSONObject.optString("patternType") now
> returns an empty string if the property is not present. However the
> code expects NULL to be returned in such cases.
>
> Because opt***(...) methods are used on several places in different
> places I will need to review all such use ages.
>
> I hope I can provide a patch for this later today. In the meantime
> please parse a valid patternType.
>
> BTW:
>
>>     "text": "Frankf*",
>
> will not return any values for pattern type 'none'
>
>
>> Thanks
>> ++
>>
>
> Thanks for the report!
>
> best
> Rupert Westenthaler
>
>

Re: entityhub/query endpoint not still running ?

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi

On Sat, Jul 23, 2011 at 8:37 PM, florent andré
<fl...@4sengines.com> wrote:
> Hi Rupert, all
>
> I just update stanbol to the last version and I figure out that
> entityhub/query don't answer to my previously running requests.
> Do this endpoint don't still like me ? :)
>
> So I run the full launcher, and restart from the online documentation (in
> entityhub enpoint / rest api ) and try examples.
>
> so I, for example :
> -------
> $ curl -X POST -H "Content-Type:application/json" --data "@fieldQueryjson"
> http://localhost:8080/entityhub/query
> -------
>
> Where
> --------
> @fieldQueryjson
> {
>    "selected": [
>        "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>        "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type"],
>    "offset": "0",
>    "limit": "3",
>    "constraints": [
> {
>    "type": "value",
>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
>    "value": "Paris",
> }
>
>        ]
> }
> ---------
>
> Answer :
> ---------
> {
>    "query": {
>        "selected": [
>            "http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type",
>            "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>        ],
>        "constraints": [{
>            "type": "value",
>            "value": "Paris",
>            "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
>        }],
>        "limit": 3
>    },
>    "results": []
> ----------
>

This result is expected for the DBPedia dataset because value
constraints do map parsed values to the data type "xsd:String" however
the Entityhub uses "entityhub:text" for natural language values. I
will update the example of the online help to use a more typical
example. I will also add a list of supported data types.

The get the results expected results you would need to use the
following constraint

       "constraints": [{
           "type": "value",
           "value": "Paris",
           "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label",
           "dataTypes": ["http://www.iks-project.eu/ontology/rick/model/text"]
       }],

In addition I will implement support for "prefix:localname" so that it
is possible to use "entityhub:text" instead of the full URL

> Others examples do the same.
>
> Do I miss something ?
>
> Another point :
>
> I see that for constraints type:text, the field patternType is now
> mandatory... even if documentation says that default value is to "none" and
> in previous version we can miss this property without problems.
>
> When no pattern type is in the request, message is :
> Constraint parsing Errors:
>
> Illegal value for field 'patternType'.
> Supported values are: [none, regex, wildcard]
> Parsed Constraint:
> {
>    "type": "text",
>    "languages": ["de"],
>    "text": "Frankf*",
>    "field": "http:\/\/www.w3.org\/2000\/01\/rdf-schema#label"
> }
>

The reason for that is that "JSONObject.optString("patternType") now
returns an empty string if the property is not present. However the
code expects NULL to be returned in such cases.

Because opt***(...) methods are used on several places in different
places I will need to review all such use ages.

I hope I can provide a patch for this later today. In the meantime
please parse a valid patternType.

BTW:

>    "text": "Frankf*",

will not return any values for pattern type 'none'


> Thanks
> ++
>

Thanks for the report!

best
Rupert Westenthaler


-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen