Dear Arthur,
Thanks for the prompt answer, I will try. Here, is the ontology as RDF/XML
file:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.semanticweb.org/darius/ontologies/2013/6/rooms#"
xml:base="http://www.semanticweb.org/darius/ontologies/2013/6/rooms"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Person-->
<owl:Class rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Person"/>
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#City -->
<owl:Class rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#City"/>
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Gender-->
<owl:Class rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Gender"/>
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Ivan -->
<owl:NamedIndividual rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Ivan">
<rdf:type rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Person"/>
<owl:topObjectProperty rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Male"/>
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Ana -->
<owl:NamedIndividual rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Ana">
<rdf:type rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Person"/>
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Male -->
<owl:NamedIndividual rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Male">
<rdf:type rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Gender"/>
<!-- http://www.semanticweb.org/darius/ontologies/2013/6/rooms#London -->
<owl:NamedIndividual rdf:about="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#London">
<rdf:type rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#City"/>
<owl:topObjectProperty rdf:resource="
http://www.semanticweb.org/darius/ontologies/2013/6/rooms#Male"/>
2013/8/19 Arthur Vaïsse-Lesteven <[email protected]>
> 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
>