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é
<[email protected]>  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


Reply via email to