Skip to content

Commit

Permalink
Release 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
IKCAP committed Jun 7, 2024
1 parent 652a8ae commit 260d13a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>edu.isi.kcap</groupId>
<artifactId>ontapi</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>

<scm>
<connection>
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/edu/isi/kcap/ontapi/jena/KBAPIJena.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ private void initialize(OntSpec spec, final Dataset tdbstore) throws Exception {

submodels = new ArrayList<KBAPIJena>();

if(this.url != null) {
// Fix Ontology URL changes
this.url = getFixedOntologyUrl(this.url);
}

OntDocumentManager.getInstance().setProcessImports(false);
if (tdbstore == null || this.url == null)
{
Expand All @@ -145,7 +150,7 @@ private void initialize(OntSpec spec, final Dataset tdbstore) throws Exception {
readModel();
}
else
{
{
// If there is a triple tdbstore
this.tdbstore = tdbstore;
Txn.executeWrite(tdbstore, ()->{
Expand All @@ -161,10 +166,22 @@ private void initialize(OntSpec spec, final Dataset tdbstore) throws Exception {
});
}
}

private String getFixedOntologyUrl(String url) {
String onturl = "http://www.wings-workflows.org/ontology";
String newonturl = "https://wings-workflows.org/ontology";
if (url.startsWith(onturl)) {
return newonturl + url.substring(onturl.length());
}
return url;
}

private void readModel() throws Exception {
if (ontmodel != null) {
if (this.url != null) {
if (this.url.startsWith("urn:")) {
return;
}
try {
ontmodel.read(this.url);
}
Expand Down

0 comments on commit 260d13a

Please sign in to comment.