Exécution d'une simple requête
Bonjour,
J'ai créé une ontologie sur un domaine de sport. J'ai un soucis sur Sparql, j'arrive pas comprends comment il fonctionne (tous qui est prefixe, vcard ..)
J'ai créé mon ontologie sous Protégé 3.2 dont l'entête est:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <rdf:RDF
xmlns="http://www.owl-ontologies.com/OntologySportive.owl#"
xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns: p2="http://www.w3.org/2001/vcard-rdf/3.0#"
xmlns: assert="http://www.owl-ontologies.com/assert.owl#"
xmlns: owl="http://www.w3.org/2002/07/owl#"
xmlns: xsd="http://www.w3.org/2001/XMLSchema#"
xmlns: rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns: p1="http://www.w3.org/2001/XMLSchema/"
xml:base="http://www.owl-ontologies.com/OntologySportive.owl">
<owl:Ontology rdf:about=""/>
<owl:Class rdf:ID="Personne">
<owl:disjointWith>
<owl:Class rdf:ID="Sport"/>
</owl:disjointWith>
<owl:disjointWith>
<owl:Class rdf:ID="Association"/>
<!-- ... --> |
Comment je fais pour écrire une simple requête donc par exemple pour extraire toutes les personnes?
extraire les noms avec sparql
SVP j'ai utilisé cette requête pour extraire les noms des chercheurs sachant que j'ai ajouté les individus sur mon ontologie voila mon code:
Code:
1 2 3 4 5
| String queryString = "PREFIX espace :<http://www.semanticweb.org/ontologies/2012/3/untitled-ontology-59> "+ //myOntologyPrefix +rdfPrefix +
"SELECT ?Nom " +
"FROM <http://www.semanticweb.org/ontologies/2012/3/untitled-ontology-59#Chercheur>" +
"WHERE {" + "?Nom espace:Chercheur ?Nom. "+
"}"; |
sachant j’utilise API JENA merci