There is missing information about object properties. And the link between Ivan
and London isn't clear.
Assuming you are requesting a query to create a triple of type (Ivan, a
relation, London) you could try something like this:
INSERT{ ?person isRelatedTo ?city}
WHERE{
?person a Person.
?person name "Ivan"^^xsd:String.
?city a City.
?city name "London"^^xsd:String.
}
where "isRelatedTo" is an object properties of your choice.
This query will create a triple for each city with a name of London and every
Person with a name equal to "Ivan".
I hope this will help you. For more information about SPARQL queries I suggest
you to read the current W3C Recommendation (
http://www.w3.org/TR/sparql11-query/ )
It would be much easier to help you with your minimal ontology include in the
mail.
VAÏSSE-LESTEVEN Arthur
>Dear Sir or Madam,
>
>let's say I have an ontology, to make things clear and simple it looks like
>this one:
>
>a) three classes, every one has two individuals:
>Person: Ivan and Ana;
>City: London and Paris;
>Gender: Male and Female.
>
>b) Ivan from the class "Person" is related to Male from the class "Gender";
>London from the class "City" is related to Male from the class "Gender".
>
>How to write the SPARQL query to find/connect Ivan from the class "Person"
>to London from the class "City"?
>
>In SQL it would look something the following way (between, it could be
>wrong):
>SELECT London FROM City WHERE Ivan=Male AND London=Male;
>
>
>Sincerely Yours,
>
>Darius Miliauskas