Hi,
in general I agree with Reto: the problem here is, that the relation
between input and output is not clear in WS2. However, your service
description is fine and claims this relationship with ?x, the problem
lies in your input data. In general I would strongly discourage using
input data, that allows save variables (i.e., variables that appear in
input and output description) to be bound with blanks.
A Change of the service description as proposed by Reto solves your
problem to some extend, but would still lead to some problems:
Consider an example with INPUT:
[ a myontology:city;
myontology:hasName "hometown"]
and OUTPUT:
[ myontology:hasName "hometown";
weather:celsiusTemperature "30"]
Semantically speaking the service would return a temperature of
something that has the same name as the city described in the INPUT
(but not necessarily the same thing). Your service description on the
other hand claims that you give the temperature of the described city
(by using ?x as save variable).
So the best solution would be to identify the city with a real URI (as
Reto suggested), or if you have no way of doing so, you should go all
the way and change the service description to:
----------------------------------------------
WS2:
consumes:
{ [ a myontology:City;
myontology:hasName ?y ] }
produces:
{ [ myontology:hasName ?y ;
weather:celsiusTemperature ?z ] }
----------------------------------------------
because that is what your service does, really.
Another real dirty solution to your specific problem (just working on
a single triplestore) would be to SELECT the blanknode and holding it
programmatically (depending on your implementation e.g. as a java
variable of Type "RDFNode"). Then you could build the new triple with
temperature using exactly the same blanknode as subject and save this
triple back to your store. so your store would hold:
[ a myontology:city;
myontology:hasName "hometown";
weather:celsiusTemperature "30"]
This would make use of the fact, that most implementations use
internal identifiers for blanknodes, which you would reuse. But
considering that it should be possible to call a Linked Service "from
the outside" in a RESTful style (i.e. HTTP POST the INPUT to it and
getting RDF as response), this way certainly is more of a hack than a
real solution.
hope this was helpful.
Regards,
Steffen