IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SPARQL Discussion :

Extraire des informations d'une ontologie OWL-S


Sujet :

SPARQL

  1. #1
    Membre du Club
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2012
    Messages
    66
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2012
    Messages : 66
    Points : 51
    Points
    51
    Par défaut Extraire des informations d'une ontologie OWL-S
    Bonsoir, je voudrais extraire des information à partir d'une ontologie owls (c'est à dire contenant un service web annoté sémantiquement) que j'ai trouvé en ligne (lien : http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl ). J'ai procédé ensuite à à la traduction de l'ontologie vers RDF pour que je puisse extraire les informations que je veux à partir d'une requête SPARQL dont le code est le suivant:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
     
    <rdf:RDF
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:process="http://www.daml.org/services/owl-s/1.1/Process.owl#"
        xmlns:service="http://www.daml.org/services/owl-s/1.1/Service.owl#"
        xmlns:list="http://www.daml.org/services/owl-s/1.1/generic/ObjectList.owl#"
        xmlns:owl="http://www.w3.org/2002/07/owl#"
        xmlns:mind="http://www.mindswap.org/2004/owl-s/1.1/MindswapProfileHierarchy.owl#"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
        xmlns:profile="http://www.daml.org/services/owl-s/1.1/Profile.owl#"
        xmlns:grounding="http://www.daml.org/services/owl-s/1.1/Grounding.owl#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#Currency">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Input"/>
        <rdfs:label>Output Currency</rdfs:label>
        <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://www.daml.ecs.soton.ac.uk/ont/currency.owl#Currency</process:parameterType>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookName">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Input"/>
        <rdfs:label>Book Name</rdfs:label>
        <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://www.w3.org/2001/XMLSchema#string</process:parameterType>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A0">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Perform"/>
        <process:process rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl#BookFinderProcess"/>
        <process:hasDataFrom rdf:nodeID="A1"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceService">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Service.owl#Service"/>
        <service:describedBy rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceProcess"/>
        <service:supports rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceGrounding"/>
        <service:presents rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceProfile"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A2">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#InputBinding"/>
        <process:toParam rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl#BookInfo"/>
        <process:valueSource rdf:nodeID="A3"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A4">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Perform"/>
        <process:process rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl#CurrencyConverterProcess"/>
        <process:hasDataFrom rdf:nodeID="A5"/>
        <process:hasDataFrom rdf:nodeID="A6"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceProcess">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#CompositeProcess"/>
        <service:describes rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceService"/>
        <process:hasInput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookName"/>
        <process:hasInput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#Currency"/>
        <process:hasOutput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPrice"/>
        <process:composedOf rdf:nodeID="A7"/>
        <process:hasResult rdf:nodeID="A8"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A9">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#OutputBinding"/>
        <process:toParam rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPrice"/>
        <process:valueSource rdf:nodeID="A10"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A1">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#InputBinding"/>
        <process:toParam rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl#BookName"/>
        <process:valueSource rdf:nodeID="A11"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A7">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Sequence"/>
        <process:components rdf:nodeID="A12"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A6">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#InputBinding"/>
        <process:toParam rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl#OutputCurrency"/>
        <process:valueSource rdf:nodeID="A13"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A14">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Perform"/>
        <process:process rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl#BNPriceProcess"/>
        <process:hasDataFrom rdf:nodeID="A2"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A15">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ControlConstructList"/>
        <list:first rdf:nodeID="A4"/>
        <list:rest rdf:resource="http://www.daml.org/services/owl-s/1.1/generic/ObjectList.owl#nil"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceProfile">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Profile.owl#Profile"/>
        <rdf:type rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/MindswapProfileHierarchy.owl#BookInformationService"/>
        <service:presentedBy rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceService"/>
        <profile:serviceName xml:lang="en">Book Price Finder</profile:serviceName>
        <profile:textDescription xml:lang="en">Returns the price of a book in the desired currency. First the ISBN number for the given book is found and then this ISBN number is used to get the prive of the book from Barnes &amp; Nobles service.</profile:textDescription>
        <profile:hasInput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookName"/>
        <profile:hasInput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#Currency"/>
        <profile:hasOutput rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPrice"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A5">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#InputBinding"/>
        <process:toParam rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl#InputPrice"/>
        <process:valueSource rdf:nodeID="A16"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A17">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ControlConstructList"/>
        <list:first rdf:nodeID="A14"/>
        <list:rest rdf:nodeID="A15"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A8">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Result"/>
        <process:withOutput rdf:nodeID="A9"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A3">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf"/>
        <process:fromProcess rdf:nodeID="A0"/>
        <process:theVar rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl#BookInfo"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A11">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf"/>
        <process:fromProcess rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#TheParentPerform"/>
        <process:theVar rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookName"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A12">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ControlConstructList"/>
        <list:first rdf:nodeID="A0"/>
        <list:rest rdf:nodeID="A17"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A10">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf"/>
        <process:fromProcess rdf:nodeID="A4"/>
        <process:theVar rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl#OutputPrice"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceGrounding">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Grounding.owl#WsdlGrounding"/>
        <grounding:hasAtomicProcessGrounding rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl#CurrencyConverterProcessGrounding"/>
        <grounding:hasAtomicProcessGrounding rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl#BNPriceProcessGrounding"/>
        <grounding:hasAtomicProcessGrounding rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl#BookFinderProcessGrounding"/>
        <service:supportedBy rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPriceService"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl">
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/>
        <owl:imports rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl"/>
        <owl:imports rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl"/>
        <owl:imports rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl"/>
        <owl:imports rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/MindswapProfileHierarchy.owl"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A16">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf"/>
        <process:fromProcess rdf:nodeID="A14"/>
        <process:theVar rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl#BookPrice"/>
      </rdf:Description>
      <rdf:Description rdf:nodeID="A13">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#ValueOf"/>
        <process:fromProcess rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#TheParentPerform"/>
        <process:theVar rdf:resource="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#Currency"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://www.mindswap.org/2004/owl-s/1.1/BookPrice.owl#BookPrice">
        <rdf:type rdf:resource="http://www.daml.org/services/owl-s/1.1/Process.owl#Output"/>
        <rdfs:label>Output Price</rdfs:label>
        <process:parameterType rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://www.mindswap.org/2004/owl-s/concepts.owl#Price</process:parameterType>
      </rdf:Description>
    </rdf:RDF>
    Je veux maintenant extraire le nom du service suivant : Book Name celui compris entre les deux balises
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <rdfs:label>Book Name</rdfs:label>
    et extraire également l'input (BookName) et l'ouput (BookPrice) du service en question.

    Comment peut-on faire cela avec une requête SPARQL?

    Merci d'avance

  2. #2
    Membre du Club
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2012
    Messages
    66
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2012
    Messages : 66
    Points : 51
    Points
    51
    Par défaut
    Pour tester, je voulais afficher le nom du service avec la requete suivante:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    		String queryString ="SELECT * WHERE { ?Service <http://www.daml.org/services/owl-s/1.1/Service.owl#Service> ?Service . }";
    ça m'affiche toutefois rien comme résultat

  3. #3
    Rédacteur/Modérateur
    Avatar de Metafire18
    Homme Profil pro
    Ingénieur de recherche Orange Labs
    Inscrit en
    Décembre 2007
    Messages
    777
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Territoire de Belfort (Franche Comté)

    Informations professionnelles :
    Activité : Ingénieur de recherche Orange Labs

    Informations forums :
    Inscription : Décembre 2007
    Messages : 777
    Points : 1 894
    Points
    1 894
    Billets dans le blog
    1
    Par défaut
    Bonjour,

    Tout d'abord, si vous souhaitez acquérir des bases dans l'utilisation du langage SPARQL, je vous invite à consulter ce tutoriel.

    La requête que vous avez proposé signifie que vous souhaitez obtenir tous les triplets ayant un sujet et un objet identique (vous utilisez le paramètre ?Service à deux reprises) et ayant pour propriété service:Service. Au regard de votre ontologie, je ne suis pas étonné que vous n'obteniez rien en retour de cette requête
    Pas de grandeur pour qui veut grandir. Pas de modèle pour qui cherche ce qu'il n'a jamais vu.

Discussions similaires

  1. [Jena] Extraire des informations sur une ontologie par SPARQL
    Par lilyou dans le forum Frameworks
    Réponses: 6
    Dernier message: 15/04/2012, 20h20
  2. [Protégé] Extraire des données d'une ontologie OWL
    Par ines2011 dans le forum Ontologies
    Réponses: 3
    Dernier message: 18/10/2011, 10h55
  3. [Mail] Extraire des informations d'une liste
    Par Justin_C dans le forum Langage
    Réponses: 2
    Dernier message: 02/02/2007, 10h00
  4. Extraire des informations d'une page web
    Par lr dans le forum Entrée/Sortie
    Réponses: 3
    Dernier message: 28/03/2006, 12h38
  5. [RegEx] Extraire des informations d'une requête SQL
    Par XtofRoland dans le forum Langage
    Réponses: 13
    Dernier message: 07/03/2006, 15h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo