Précédent   Forum du club des développeurs et IT Pro > Webmasters - Développement Web > Web sémantique > SPARQL
SPARQL Forum d'entraide sur SPARQL.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 27/07/2012, 00h54   #1
sciencesinfo
Invité de passage
 
Femme
étudiante en mastère
Inscription : septembre 2011
Messages : 12
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : Tunisie

Informations professionnelles :
Activité : étudiante en mastère
Secteur : Enseignement

Informations forums :
Inscription : septembre 2011
Messages : 12
Points : 3
Points : 3
Par défaut Erreur au niveau de l'insertion

J'ai essayé d'ajouter des instances à mon ontologie via ce code, en effet je veux ajouter un individu pour la classe book, nommé book11. la classe book a comme propriétés title et creator, lors de l'ajout je vais insérer des connaissances au niveau de ces datatype properties :
Lorsque j'exécute il m'affiche comme résultat:
Citation:
null graph
java.lang.NullPointerException
BUILD SUCCESSFUL (total time: 1 second)
Code :
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
 
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.update.UpdateAction;
import com.hp.hpl.jena.update.UpdateExecutionFactory;
import com.hp.hpl.jena.update.UpdateFactory;
import com.hp.hpl.jena.update.UpdateRequest;
import com.hp.hpl.jena.util.FileManager;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.query.QueryException;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.sparql.sse.SSE;
import com.hp.hpl.jena.update.GraphStoreFactory;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.omg.CORBA.portable.InputStream;
 
public class Insert {
     public static final String owlFile="C://Project//Book.owl";
        public static final String NL      = System.getProperty("line.separator") ;
        public static void main( String[] args ) {
        Model model = ModelFactory.createDefaultModel() ;
 String insertString="PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> \n" 
                  +"PREFIX had:<http://www.owl-ontologies.com/Ontology1337080298.owl>"
                  + "PREFIX base:<http://www.owl-ontologies.com/Ontology1337080298.owl>"
                 + "INSERT DATA"
                    + "{GRAPH <http://www.owl-ontologies.com/Ontology1337080298.owl#book>"
 
                  + "{"
             + " <http://www.owl-ontologies.com/Ontology1337080298.owl#book11> had:title\"informatique\"^^xsd:string;"
                  + "}" 
                    +"}"; 
         try {
 
 
                        UpdateAction.parseExecute(insertString, model);
 
        } catch (Exception e) {
 
            System.out.println(e);
 
        }
        }
}
Existe-t-il quelqu'un qui peut m'aider à résoudre le problème, et merci
sciencesinfo est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 19h47.


 
 
 
 
Partenaires

Hébergement Web