https://protegewiki.stanford.edu/index.php?title=LoadFramesOntologyFromDB&feed=atom&action=history
LoadFramesOntologyFromDB - Revision history
2024-03-29T05:23:20Z
Revision history for this page on the wiki
MediaWiki 1.27.7
https://protegewiki.stanford.edu/index.php?title=LoadFramesOntologyFromDB&diff=1325&oldid=prev
JenniferVendetti at 00:54, February 23, 2008
2008-02-23T00:54:17Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 00:54, February 23, 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><span style="font-weight:bold; font-size:18px;">How do I load a Protege-Frames ontology from a Protege <del class="diffchange diffchange-inline">Database </del>using the API?</span><br /><br /></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><span style="font-weight:bold; font-size:18px;">How do I load a Protege-Frames ontology from a Protege <ins class="diffchange diffchange-inline">database </ins>using the API?</span><br /><br /></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Method 1'''</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>'''Method 1'''</div></td></tr>
</table>
JenniferVendetti
https://protegewiki.stanford.edu/index.php?title=LoadFramesOntologyFromDB&diff=1322&oldid=prev
JenniferVendetti: migrating this page from old cim3 wiki
2008-02-23T00:42:07Z
<p>migrating this page from old cim3 wiki</p>
<p><b>New page</b></p><div><span style="font-weight:bold; font-size:18px;">How do I load a Protege-Frames ontology from a Protege Database using the API?</span><br /><br /><br />
<br />
'''Method 1'''<br />
<br />
The simplest way to load a Protege-Frames ontology from a database is to programatically load the project file (.pprj), which already contains all of the necessary database connection information:<br />
<br />
<code><br />
Project prj = Project.loadProjectFromFile("/tmp/newspaper.pprj",errors);<br /><br />
KnowledgeBase kb = prj.getKnowledgeBase();<br /><br />
...<br />
</code><br /><br /><br />
<br />
'''Method 2'''<br />
<br />
The second method should be used if there is no project file (.pprj) associated with the Protege-Frames database ontology:<br />
<br />
<code><br />
DatabaseKnowledgeBaseFactory factory = new DatabaseKnowledgeBaseFactory();<br /><br />
Collection errors = new ArrayList();<br /><br /><br />
Project project = Project.createNewProject(factory, errors);<br /><br />
//replace the arguments with your own specific values<br /><br />
DatabaseKnowledgeBaseFactory.setSources(project.getSources(), "com.mysql.jdbc.Driver", "jdbc:mysql://localhost/protege", "table", "user", "password");<br /><br /><br />
project.createDomainKnowledgeBase(factory, errors, true);<br /><br /><br />
//the following lines are optional. Use them only if you want to save the project<br /><br />
project.setProjectURI(new URI("file:/tmp/newspaper_saved.pprj"));<br /><br />
project.save(errors);<br /><br />
...<br />
</code></div>
JenniferVendetti