bonjour,
j'ai un fichier xml qui contient la structure et les instances de mon ontologie.
j'ai aussi une ontologie sous protégé vide sans instances mais elle existe avec les concepts et les datatype properties et les objects properties .
j'utilise l'api jena pour le peuplement de cette ontologie à partir du fichier xml.
mais je n'ai pas réussi :'(

voilà mon xml
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
<CotsComponent>
<ComponentName>
.Net Advanced Button
</ComponentName>
<ComponentDescription>
A .NET button control that gives your applications a similar look to Windows Vista buttons. .Net Advanced Button is 
 
a fast, small, lightweight and easy to use .NET control that gives your applications enhanced and high quality 
 
graphical buttons. With Softgroup .Net Advanced Button you can create applications with gradient and/or light 
 
effects buttons that have similar effects as the Microsoft Windows Vista look and style. To use .Net Advanced 
 
Button simply add the control to the Toolbox window of Microsoft Visual Studio and drag it on to your form.Visual 
 
Studio 2005 and 2008 compatible (VS2005, VS2008). VB.NET and C# (CSharp) samples included. All licenses include 
 
12 Months Subscription. Source Code Included with Site Wide Licenses.
</ComponentDescription>
<License>
<licence1>
1 Developer Subscription License with Priority Support
<price1>
$ 92.70
</price1>
</licence1>
<licence2>
4 Developer Subscription Team License with Priority Support
<price2>
$ 276.85
</price2>
</licence2>
<licence3>
8 Developer Subscription Team License with Priority Support
<price3>
$ 461.00
</price3>
</licence3>
<licence4>
1 Site Wide License with Subscription with Priority Support 
<price4>
$ 920.75
</price4>
</licence4>
</License>
<Publisher>
<Nompublisher>
Softgroup
</Nompublisher>
<Descriptionpublisher>
Softgroup is an Italian company with more than ten years of experience in realizing ERP products on Microsoft 
 
Windows platforms and it is especially known on the market for its Galileo 2000 and GeminiXP products used by 
 
companies operating in various fields. Since 2004 Softgroup has been developing .NET components to access to 
 
databases applying the experience it has acquired throughout the years. The main features of Softgroup are a 
 
strong innovative spirit, a continuous search for advanced solutions and the achievement of avant-garde 
 
applications and components. The Softgroup production group is made up of expert analysts and developers that 
 
are able to furnish a complete analysis and assessment service and convert it to highly evolved software.
</Descriptionpublisher>
</Publisher>
<ComponentModel>
</ComponentModel>
<Componenttype>
by Softgroup - Product Type: Component / .NET WinForms / 100% Managed Code
</Componenttype>
<OperatingSystem>
OperatingSystem:Microsoft (14)
</OperatingSystem>
<Domain>
Button and Cursor Design
</Domain>
<Service>
</Service>
<QualityCharacteristic>
          <Efficiency>
                     <Resource_Behavior>
                              <Disk_Utilization>
Disk Space Required: 5MB
 
                              </Disk_Utilization>
                              <Memory_Utilization>
                              </Memory_Utilization>
                     </Resource_Behavior>
 
          </Efficiency>
          <Functionality>
                    <Compliance>
                              <Certification>
                              </Certification>
                              <Standardization>
                              </Standardization>
                    </Compliance>
 
          </Functionality>
       </QualityCharacteristic>
<Useguidline>
<Documentation>
jhluhmo
</Documentation>
<Useexample>
</Useexample>
</Useguidline>
<Customerreview>
</Customerreview>
et voilà mon code java


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
 
import com.hp.hpl.jena.ontology.Individual;
import com.hp.hpl.jena.ontology.OntClass;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.util.FileManager;
import java.io.*;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import java.io.*;
import org.jdom.*;
import org.jdom.output.*;
import java.util.List;
import java.util.Iterator;
 
 
public class JDOM2
{
   static org.jdom.Document document;
   static Element racine;
 
   public static void main(String[] args)
   {
      //On crée une instance de SAXBuilder
      SAXBuilder sxb = new SAXBuilder();
      try
      {
         //On crée un nouveau document JDOM avec en argument le fichier XML
         //Le parsing est terminé ;)
         document = sxb.build(new File("hela.xml"));
      }
      catch(Exception e){}
 
      //On initialise un nouvel élément racine avec l'élément racine du document.
      racine = document.getRootElement();
 
      System.out.println(racine.getName());
      afficheALL();
   }
  static void afficheALL()
{ List listB = racine.getChildren("Publisher");
       Iterator j = listB.iterator();
   while(j.hasNext())
   {
      //On recrée l'Element courant à chaque tour de boucle afin de
      //pouvoir utiliser les méthodes propres aux Element comme :
      //sélectionner un nœud fils, modifier du texte, etc...
      final Element courant = (Element)j.next();
      //On affiche le nom de l’élément courant
      System.out.println("publisher name : " +courant.getChild("Nompublisher").getText());
      System.out.println("publisher description : " +courant.getChild("Descriptionpublisher").getText());
 
 
       OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_TRANS_INF, null);
       String inputFileName = "ONTOCOTS090513.owl";
       InputStream in = FileManager.get().open(inputFileName);
       if (in == null) {
       throw new IllegalArgumentException("File: " + inputFileName + " not found");
               }
       model.read(in, "RDF/XML");
       String NS = "http://www.owl-ontologies.com/ONTOCOTS.owl#";
       OntClass classPublisher = model.getOntClass(NS + "Publisher");
        Individual I1 = model.createIndividual(NS +courant.getChild("Nompublisher").getText(),classPublisher);
           model.write(System.out);
                        PrintStream p;
                        try {
                            p = new PrintStream("ONTOCOTS090513.owl");
                            model.write(p);
                            p.close();
                            } catch (FileNotFoundException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                                }
   }
}
}
Merci d'avance