Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development for release 3.1.1 #233

Merged
merged 8 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.bridgedb.examples</groupId>
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.bio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ICD-11 ICD11 http://www.who.int/classifications/icd/en/ 1A95 unknown Homo sapie
Illumina Il http://www.illumina.com/ ILMN_5668 probe 0 Il ILMN_\d+ Illumina illumina.probe probe
InChIKey Ik http://inchi.org/ QTBSBXVTEAMEQO-UHFFFAOYSA-N metabolite 1 urn:miriam:inchikey ^[A-Z]{14}\-[A-Z]{10}(\-[A-Z])? Standard InChIKey P235 inchikey metabolite
IntAct Ia http://www.ebi.ac.uk/intact/ http://www.ebi.ac.uk/intact/pages/details/details.xhtml?interactionAc=$id EBI-2307691 interaction 1 urn:miriam:intact ^EBI\-[0-9]+$ IntAct intact interaction
InterPro I http://www.ebi.ac.uk/interpro/ http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=$id IPR000100 protein 1 urn:miriam:interpro ^IPR\d{6}$ InterPro P2926 interpro protein
InterPro I http://www.ebi.ac.uk/interpro/ https://www.ebi.ac.uk/interpro/entry/InterPro/$id IPR000100 protein 1 urn:miriam:interpro ^IPR\d{6}$ InterPro P2926 interpro protein
IPI Ip http://www.ebi.ac.uk/IPI http://www.ebi.ac.uk/cgi-bin/dbfetch?db=IPI&id=$id&format=default IPI00000001 protein 1 ^IPI\d{8}$ IPI interpro protein
IRGSP Gene Ir http://rgp.dna.affrc.go.jp/IRGSP/ https://rapdb.dna.affrc.go.jp/viewer/gbrowse_details/irgsp1?name=$id Os12g0561000 gene 1 Ir Os\d{2}g\d+ IRGSP Gene rapdb.locus gene
ISBN isbn http://isbndb.com/ http://isbndb.com/search-all.html?kw=$id 9781584885658 publication 1 urn:miriam:isbn ^(ISBN)?(-13|-10)?[:]?[ ]?(\d{2,3}[ -]?)?\d{1,5}[ -]?\d{1,7}[ -]?\d{1,6}[ -]?(\d|X)$ ISBN P212 isbn publication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ICD-11 ICD11 http://www.who.int/classifications/icd/en/ 1A95 unknown Homo sapie
Illumina Il http://www.illumina.com/ ILMN_5668 probe 0 Il ILMN_\d+ Illumina illumina.probe probe
InChIKey Ik http://inchi.org/ QTBSBXVTEAMEQO-UHFFFAOYSA-N metabolite 1 urn:miriam:inchikey ^[A-Z]{14}\-[A-Z]{10}(\-[A-Z])? Standard InChIKey P235 inchikey metabolite
IntAct Ia http://www.ebi.ac.uk/intact/ http://www.ebi.ac.uk/intact/pages/details/details.xhtml?interactionAc=$id EBI-2307691 interaction 1 urn:miriam:intact ^EBI\-[0-9]+$ IntAct intact interaction
InterPro I http://www.ebi.ac.uk/interpro/ http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=$id IPR000100 protein 1 urn:miriam:interpro ^IPR\d{6}$ InterPro P2926 interpro protein
InterPro I http://www.ebi.ac.uk/interpro/ https://www.ebi.ac.uk/interpro/entry/InterPro/$id IPR000100 protein 1 urn:miriam:interpro ^IPR\d{6}$ InterPro P2926 interpro protein
IPI Ip http://www.ebi.ac.uk/IPI http://www.ebi.ac.uk/cgi-bin/dbfetch?db=IPI&id=$id&format=default IPI00000001 protein 1 ^IPI\d{8}$ IPI interpro protein
IRGSP Gene Ir http://rgp.dna.affrc.go.jp/IRGSP/ https://rapdb.dna.affrc.go.jp/viewer/gbrowse_details/irgsp1?name=$id Os12g0561000 gene 1 Ir Os\d{2}g\d+ IRGSP Gene rapdb.locus gene
ISBN isbn http://isbndb.com/ http://isbndb.com/search-all.html?kw=$id 9781584885658 publication 1 urn:miriam:isbn ^(ISBN)?(-13|-10)?[:]?[ ]?(\d{2,3}[ -]?)?\d{1,5}[ -]?\d{1,7}[ -]?\d{1,6}[ -]?(\d|X)$ ISBN P212 isbn publication
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.file.orthoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.rdb.construct/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
4 changes: 2 additions & 2 deletions org.bridgedb.rdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.9.3</version>
<version>1.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.rdf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>bridgedb-bundle</artifactId>
<groupId>org.bridgedb</groupId>
<version>3.1.0</version>
<version>3.1.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
2 changes: 1 addition & 1 deletion org.bridgedb.rdf/resources/DataSource.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ bridgeDB:DataSource_InterPro a bridgeDB:DataSource ;
bridgeDB:idExample "IPR000100" ;
bridgeDB:primary "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
bridgeDB:type "protein" ;
bridgeDB:hasPrimaryUriPattern <http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=$id> ;
bridgeDB:hasPrimaryUriPattern <https://www.ebi.ac.uk/interpro/entry/InterPro/$id> ;
bridgeDB:hasIdentifiersOrgPattern <http://identifiers.org/interpro/$id> ;
bridgeDB:hasUriPattern <http://bio2rdf.org/interpro:$id> .

Expand Down
8 changes: 4 additions & 4 deletions org.bridgedb.rdf/resources/IdentifiersOrgDataSource.ttl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix bridgeDB: <http://vocabularies.bridgedb.org/ops#> .
@prefix bridgeDB: <http://vocabularies.bridgedb.org/ops#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcterms: <http://purl.org/dc/terms/> .

Expand Down Expand Up @@ -3101,7 +3101,7 @@ bridgeDB:DataSource_InterPro a bridgeDB:DataSource ;
bridgeDB:idExample "IPR000100" ;
bridgeDB:primary "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
bridgeDB:type "protein" ;
bridgeDB:hasPrimaryUriPattern <http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=$id> ;
bridgeDB:hasPrimaryUriPattern <https://www.ebi.ac.uk/interpro/entry/InterPro/$id> ;
bridgeDB:hasIdentifiersOrgPattern <http://identifiers.org/interpro/$id> ;
bridgeDB:hasIdentifiersOrgInfoPattern <http://info.identifiers.org/interpro/$id> ;
bridgeDB:hasRegexPattern "^IPR\\d{6}$" ;
Expand Down Expand Up @@ -11427,8 +11427,8 @@ bridgeDB:Organism_Zm a bridgeDB:Organism ;
<http://www.ebi.ac.uk/intenz/query?cmd=SearchEC&ec=$id> a bridgeDB:UriPattern ;
bridgeDB:hasPrefix "http://www.ebi.ac.uk/intenz/query?cmd=SearchEC&ec=" .

<http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=$id> a bridgeDB:UriPattern ;
bridgeDB:hasPrefix "http://www.ebi.ac.uk/interpro/DisplayIproEntry?ac=" .
<https://www.ebi.ac.uk/interpro/entry/InterPro/$id> a bridgeDB:UriPattern ;
bridgeDB:hasPrefix "https://www.ebi.ac.uk/interpro/entry/InterPro/" .

<http://www.ebi.ac.uk/interpro/entry/$id> a bridgeDB:UriPattern ;
bridgeDB:hasPrefix "http://www.ebi.ac.uk/interpro/entry/" .
Expand Down
44 changes: 19 additions & 25 deletions org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.Value;
import org.eclipse.rdf4j.model.impl.BooleanLiteralImpl;
import org.eclipse.rdf4j.model.impl.LiteralImpl;
import org.eclipse.rdf4j.model.impl.URIImpl;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryException;
Expand Down Expand Up @@ -86,7 +84,7 @@
RepositoryConnection repositoryConnection = null;
try {
repository = new SailRepository(new MemoryStore());
repository.initialize();
repository.init();
repositoryConnection = repository.getConnection();
repositoryConnection.add(stream, DEFAULT_BASE_URI, DEFAULT_FILE_FORMAT);
readAllDataSources(repositoryConnection);
Expand Down Expand Up @@ -216,7 +214,7 @@

private void readCodeMapper(RepositoryConnection repositoryConnection, String systemCode, Pattern regex) throws RepositoryException, BridgeDBException {
RepositoryResult<Statement> statements =
repositoryConnection.getStatements(null, BridgeDBConstants.SYSTEM_CODE_URI, new LiteralImpl(systemCode), true);
repositoryConnection.getStatements(null, BridgeDBConstants.SYSTEM_CODE_URI, SimpleValueFactory.getInstance().createLiteral(systemCode), true);
// String xrefPrefix = null;
Resource codeMapperReseource = null;
while (statements.hasNext()) {
Expand Down Expand Up @@ -321,7 +319,7 @@
RepositoryConnection repositoryConnection = null;
try {
repository = new SailRepository(new MemoryStore());
repository.initialize();
repository.init();

Check warning on line 322 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L322

Added line #L322 was not covered by tests
repositoryConnection = repository.getConnection();
for (DataSource dataSource: dataSources){
writeDataSource(repositoryConnection, dataSource);
Expand All @@ -341,29 +339,25 @@
repositoryConnection.add(id, RdfConstants.TYPE_URI, BridgeDBConstants.DATA_SOURCE_URI);

if (dataSource.getFullName() != null){
repositoryConnection.add(id, BridgeDBConstants.FULL_NAME_URI, new LiteralImpl(dataSource.getFullName()));
repositoryConnection.add(id, BridgeDBConstants.FULL_NAME_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getFullName()));

Check warning on line 342 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L342

Added line #L342 was not covered by tests
}

if (dataSource.getSystemCode() != null && (!dataSource.getSystemCode().trim().isEmpty())){
repositoryConnection.add(id, BridgeDBConstants.SYSTEM_CODE_URI, new LiteralImpl(dataSource.getSystemCode()));
repositoryConnection.add(id, BridgeDBConstants.SYSTEM_CODE_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getSystemCode()));

Check warning on line 346 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L346

Added line #L346 was not covered by tests
}

if (dataSource.getMainUrl() != null){
repositoryConnection.add(id, BridgeDBConstants.MAIN_URL_URI, new LiteralImpl(dataSource.getMainUrl()));
repositoryConnection.add(id, BridgeDBConstants.MAIN_URL_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getMainUrl()));

Check warning on line 350 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L350

Added line #L350 was not covered by tests
}

if (dataSource.getExample() != null && dataSource.getExample().getId() != null){
repositoryConnection.add(id, BridgeDBConstants.ID_EXAMPLE_URI, new LiteralImpl(dataSource.getExample().getId()));
repositoryConnection.add(id, BridgeDBConstants.ID_EXAMPLE_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getExample().getId()));

Check warning on line 354 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L354

Added line #L354 was not covered by tests
}

if (dataSource.isPrimary()){
repositoryConnection.add(id, BridgeDBConstants.PRIMARY_URI, BooleanLiteralImpl.TRUE);
} else {
repositoryConnection.add(id, BridgeDBConstants.PRIMARY_URI, BooleanLiteralImpl.FALSE);
}
repositoryConnection.add(id, BridgeDBConstants.PRIMARY_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.isPrimary()));

Check warning on line 357 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L357

Added line #L357 was not covered by tests

if (dataSource.getType() != null){
repositoryConnection.add(id, BridgeDBConstants.TYPE_URI, new LiteralImpl(dataSource.getType()));
repositoryConnection.add(id, BridgeDBConstants.TYPE_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getType()));

Check warning on line 360 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L360

Added line #L360 was not covered by tests
}

Pattern regex = DataSourcePatterns.getPatterns().get(dataSource);
Expand Down Expand Up @@ -391,16 +385,16 @@

Pattern pattern = DataSourcePatterns.getPatterns().get(dataSource);
if (pattern != null && !pattern.toString().isEmpty()){
Value patternValue = new LiteralImpl(pattern.toString());
Value patternValue = SimpleValueFactory.getInstance().createLiteral(pattern.toString());

Check warning on line 388 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L388

Added line #L388 was not covered by tests
repositoryConnection.add(id, BridgeDBConstants.HAS_REGEX_PATTERN_URI, patternValue);
}

if (dataSource.getAlternative() != null){
repositoryConnection.add(id, DCTermsConstants.ALTERNATIVE_URI, new LiteralImpl(dataSource.getAlternative()));
repositoryConnection.add(id, DCTermsConstants.ALTERNATIVE_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getAlternative()));

Check warning on line 393 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L393

Added line #L393 was not covered by tests
}

if (dataSource.getDescription() != null){
repositoryConnection.add(id, DCatConstants.DESCRIPTION_URI, new LiteralImpl(dataSource.getDescription()));
repositoryConnection.add(id, DCatConstants.DESCRIPTION_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getDescription()));

Check warning on line 397 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L397

Added line #L397 was not covered by tests
}

SortedSet<UriPattern> sortedPatterns = UriPattern.byCodeAndType(dataSource.getSystemCode(), UriPatternType.dataSourceUriPattern);
Expand All @@ -421,8 +415,8 @@
}
Resource id = asCodeMapperResource(dataSource);
repositoryConnection.add(id, RdfConstants.TYPE_URI, BridgeDBConstants.CODE_MAPPER_URI);
repositoryConnection.add(id, BridgeDBConstants.SYSTEM_CODE_URI, new LiteralImpl(dataSource.getSystemCode()));
Value prefixValue = new LiteralImpl(xrefPrefix);
repositoryConnection.add(id, BridgeDBConstants.SYSTEM_CODE_URI, SimpleValueFactory.getInstance().createLiteral(dataSource.getSystemCode()));
Value prefixValue = SimpleValueFactory.getInstance().createLiteral(xrefPrefix);

Check warning on line 419 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L418-L419

Added lines #L418 - L419 were not covered by tests
repositoryConnection.add(id, BridgeDBConstants.XREF_PREFIX_URI, prefixValue);

SortedSet<UriPattern> sortedPatterns = UriPattern.byCodeAndType(dataSource.getSystemCode(), UriPatternType.codeMapperPattern);
Expand Down Expand Up @@ -476,17 +470,17 @@

protected static Resource asResource(DataSource dataSource) {
if (dataSource.getFullName() == null){
return new URIImpl(BridgeDBConstants.DATA_SOURCE1 + "_bysysCode_" + scrub(dataSource.getSystemCode()));
return SimpleValueFactory.getInstance().createIRI(BridgeDBConstants.DATA_SOURCE1 + "_bysysCode_" + scrub(dataSource.getSystemCode()));

Check warning on line 473 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L473

Added line #L473 was not covered by tests
} else {
return new URIImpl(BridgeDBConstants.DATA_SOURCE1 + "_" + scrub(dataSource.getFullName()));
return SimpleValueFactory.getInstance().createIRI(BridgeDBConstants.DATA_SOURCE1 + "_" + scrub(dataSource.getFullName()));
}
}

protected static Resource asCodeMapperResource(DataSource dataSource) {
if (dataSource.getFullName() == null){
return new URIImpl(BridgeDBConstants.CODE_MAPPER1 + "_bysysCode_" + scrub(dataSource.getSystemCode()));
return SimpleValueFactory.getInstance().createIRI(BridgeDBConstants.CODE_MAPPER1 + "_bysysCode_" + scrub(dataSource.getSystemCode()));

Check warning on line 481 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L481

Added line #L481 was not covered by tests
} else {
return new URIImpl(BridgeDBConstants.CODE_MAPPER1 + "_" + scrub(dataSource.getFullName()));
return SimpleValueFactory.getInstance().createIRI(BridgeDBConstants.CODE_MAPPER1 + "_" + scrub(dataSource.getFullName()));

Check warning on line 483 in org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/BridgeDBRdfHandler.java#L483

Added line #L483 was not covered by tests
}
}

Expand Down
18 changes: 9 additions & 9 deletions org.bridgedb.rdf/src/org/bridgedb/rdf/OrganismRdf.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Set;

import org.bridgedb.bio.Organism;
import org.bridgedb.rdf.constants.BridgeDBConstants;
import org.bridgedb.rdf.constants.RdfConstants;
import org.bridgedb.utils.BridgeDBException;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.URI;
import org.eclipse.rdf4j.model.Value;
import org.eclipse.rdf4j.model.impl.LiteralImpl;
import org.eclipse.rdf4j.model.impl.URIImpl;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryException;
import org.eclipse.rdf4j.rio.RDFHandler;
Expand Down Expand Up @@ -64,8 +64,8 @@
return scrub(organism.code());
}

public static final URI getResourceId(Organism organism){
return new URIImpl(BridgeDBConstants.ORGANISM1 + "_" + getRdfLabel(organism));
public static final IRI getResourceId(Organism organism){
return SimpleValueFactory.getInstance().createIRI(BridgeDBConstants.ORGANISM1 + "_" + getRdfLabel(organism));
}

public static void addAll(RepositoryConnection repositoryConnection) throws IOException, RepositoryException {
Expand All @@ -82,11 +82,11 @@

public static void add(RepositoryConnection repositoryConnection, Organism organism)
throws IOException, RepositoryException {
URI id = getResourceId(organism);
IRI id = getResourceId(organism);

Check warning on line 85 in org.bridgedb.rdf/src/org/bridgedb/rdf/OrganismRdf.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/OrganismRdf.java#L85

Added line #L85 was not covered by tests
repositoryConnection.add(id, RdfConstants.TYPE_URI, BridgeDBConstants.ORGANISM_URI);
repositoryConnection.add(id, BridgeDBConstants.CODE_URI, new LiteralImpl(organism.code()));
repositoryConnection.add(id, BridgeDBConstants.SHORT_NAME_URI, new LiteralImpl(organism.shortName()));
repositoryConnection.add(id, BridgeDBConstants.LATIN_NAME_URI, new LiteralImpl(organism.latinName()));
repositoryConnection.add(id, BridgeDBConstants.CODE_URI, SimpleValueFactory.getInstance().createLiteral(organism.code()));
repositoryConnection.add(id, BridgeDBConstants.SHORT_NAME_URI, SimpleValueFactory.getInstance().createLiteral(organism.shortName()));
repositoryConnection.add(id, BridgeDBConstants.LATIN_NAME_URI, SimpleValueFactory.getInstance().createLiteral(organism.latinName()));

Check warning on line 89 in org.bridgedb.rdf/src/org/bridgedb/rdf/OrganismRdf.java

View check run for this annotation

Codecov / codecov/patch

org.bridgedb.rdf/src/org/bridgedb/rdf/OrganismRdf.java#L87-L89

Added lines #L87 - L89 were not covered by tests
}

public static Object readRdf(Resource organismId, Set<Statement> allStatements) throws BridgeDBException {
Expand Down
Loading