bonsoir,
svp j'ai une erreur qui persiste dans mon code et que je n'arrive pas à resoudre voici mon code:
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
  String URIB="http://www.semanticweb.org/SEVEN7/ontologies/2012/2/Ontology1331977184905.owl";
 
 
   OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
 
String inputFileName ="C:\\Users\\sarah\\Desktop\\onto.owl";
// use the FileManager to find the input file
InputStream in = FileManager.get().open(inputFileName );
if (in == null) {
           model.read(in, " ", inputFileName);
    throw new IllegalArgumentException("File: " + inputFileName + " not found");}
       OntModel mod = ModelFactory.createOntologyModel();
 
    OntClass Chercheur = mod.getOntClass(URIB+"Chercheur");
DatatypeProperty nomProp = mod.getDatatypeProperty("http://www.semanticweb.org/SEVEN7/ontologies/2012/2/Ontology1331977184905.owl#Nom");
Individual c = mod.createIndividual("http://www.semanticweb.org/SEVEN7/ontologies/2012/2/Ontology1331977184905.owl#Chercheur",Chercheur);
// on peut éventuellement mettre un langageTag:
 
Literal n = mod.createLiteral("sarah");  
       mod.createLiteralStatement(c, nomProp, n);
l'erreur est:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Exception in thread "main" java.lang.NullPointerException
	at com.hp.hpl.jena.rdf.model.impl.StatementImpl.<init>(StatementImpl.java:30)
svp pouvez vous m'aider je sais que ça avoir avec la méthode create statement