diff --git a/json-converter/pom.xml b/json-converter/pom.xml index 0bd8a9542..2a79977db 100644 --- a/json-converter/pom.xml +++ b/json-converter/pom.xml @@ -15,7 +15,7 @@ org.apache.jena apache-jena-libs - 4.9.0 + 5.0.0 pom diff --git a/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java b/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java index ff055f9ce..75ab892ce 100644 --- a/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java +++ b/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java @@ -6,8 +6,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.text.SimpleDateFormat; -import java.util.Calendar; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; @@ -24,103 +22,65 @@ public class JsonldBiopaxConverter implements JsonldConverter { private final static Logger LOG = LoggerFactory.getLogger(JsonldBiopaxConverter.class); /* - * Convert inputstream in owl/rdf format to outputsream in jsonld format + * Convert biopax owl (rdf/xml) to jsonld format. */ - public void convertToJsonld(InputStream in, OutputStream os) - throws IOException { - - File inputProcessedFile = preProcessFile(in); - LOG.info("OWl File processed successfully "); - - // print current time - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); - LOG.info("Conversion RDF to JSONLD started " - + sdf.format(Calendar.getInstance().getTime())); - - // create an empty model + public void convertToJsonld(InputStream in, OutputStream os) throws IOException { + File tmpFile = preProcessFile(in); //in gets there closed Model modelJena = ModelFactory.createDefaultModel(); - InputStream internalInputStream = new FileInputStream(inputProcessedFile); - // read the RDF/XML file - RDFDataMgr.read(modelJena, internalInputStream, Lang.RDFXML); - LOG.info("Read into Model finished " + sdf.format(Calendar.getInstance().getTime())); - - try { //close quietly and delete the temp. input file - internalInputStream.close(); - inputProcessedFile.delete(); - } catch(Exception e) {} - + in = new FileInputStream(tmpFile); + RDFDataMgr.read(modelJena, in, Lang.RDFXML); RDFDataMgr.write(os, modelJena, Lang.JSONLD); - LOG.info("Conversion RDF to JSONLD finished " + sdf.format(Calendar.getInstance().getTime())); - LOG.info(" JSONLD file " + " is written successfully."); - + LOG.info("BioPAX RDFXML to JSONLD finished"); try { //close, flush quietly + in.close(); os.close(); + tmpFile.delete(); } catch(Exception e) {} } /* - * Convert inputstream in jsonld format to outputsream if owl/rdf format + * Convert jsonld back to rdf/xml + * if that jsonld was converted from rdf/xml (e.g. biopax) originally */ public void convertFromJsonld(InputStream in, OutputStream out) { - - Model modelJena = ModelFactory.createDefaultModel(); - if (in == null) { throw new IllegalArgumentException("Input File: " + " not found"); } if (out == null) { throw new IllegalArgumentException("Output File: " + " not found"); } - - // read the JSONLD file + Model modelJena = ModelFactory.createDefaultModel(); modelJena.read(in, null, "JSONLD"); - RDFDataMgr.write(out, modelJena, Lang.RDFXML); - LOG.info(" RDF file " + " is written successfully."); - + LOG.info("JSONLD to RDFXML finished"); } /** * Converts the BioPAX data (stream) to an equivalent temporary * BioPAX RDF/XML file that contains absolute instead of (possibly) * relative URIs for all the BioPAX elements out there; and returns that file. + * This is required due to a bug in Jena lib that results in inserting '#' inside the URIs... * * @param in biopax input stream * @return a temporary file * @throws IOException */ public File preProcessFile(InputStream in) throws IOException { - - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); - LOG.info("BIOPAX Conversion started " - + sdf.format(Calendar.getInstance().getTime())); - if (in == null) { throw new IllegalArgumentException("Input File: " + " is not found"); } - SimpleIOHandler simpleIO = new SimpleIOHandler(BioPAXLevel.L3); - - // create a Paxtools Model from the BioPAX L3 RDF/XML input file (stream) - org.biopax.paxtools.model.Model model = simpleIO.convertFromOWL(in); - // - and the input stream 'in' gets closed inside the above method call - - // set for the IO to output full URIs: - - simpleIO.absoluteUris(true); - - File fullUriBiopaxInput = File.createTempFile("paxtools", ".owl"); - - fullUriBiopaxInput.deleteOnExit(); // delete on JVM exits - FileOutputStream outputStream = new FileOutputStream(fullUriBiopaxInput); - + // create a Paxtools Model from the BioPAX RDF/XML input stream + org.biopax.paxtools.model.Model model = simpleIO.convertFromOWL(in);//also closes the input stream +// model.setXmlBase(""); + simpleIO.absoluteUris(true); //forces absolute URIs in the output! + File tmpf = File.createTempFile("paxtools", ".owl"); + tmpf.deleteOnExit(); // delete on JVM exits + FileOutputStream outputStream = new FileOutputStream(tmpf); // write to an output stream (back to RDF/XML) - - simpleIO.convertToOWL((org.biopax.paxtools.model.Model) model, outputStream); // it closes the stream internally - - LOG.info("BIOPAX Conversion finished " + sdf.format(Calendar.getInstance().getTime())); - return fullUriBiopaxInput; + simpleIO.convertToOWL(model, outputStream); //also closes the output stream + return tmpf; } } diff --git a/json-converter/src/test/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverterTest.java b/json-converter/src/test/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverterTest.java index d6496fd7d..d2d381c0c 100644 --- a/json-converter/src/test/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverterTest.java +++ b/json-converter/src/test/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverterTest.java @@ -2,30 +2,46 @@ import org.junit.jupiter.api.Test; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; +import java.net.URI; + +import org.junit.jupiter.api.Assertions; public class JsonldBiopaxConverterTest { @Test - public final void test() throws IOException { + final void test() throws IOException { File jsonldTestFileName = File.createTempFile("test", ".jsonld"); File rdfTestFileName = File.createTempFile("test", ".rdf"); - JsonldConverter intf = new JsonldBiopaxConverter(); - + JsonldConverter converter = new JsonldBiopaxConverter(); // convert owl test file in resource directory to jsonld format InputStream in = getClass().getResourceAsStream("/PC2v5test-Signaling-By-BMP-Pathway-REACT_12034.2.owl"); - intf.convertToJsonld(in, new FileOutputStream(jsonldTestFileName)); + converter.convertToJsonld(in, new FileOutputStream(jsonldTestFileName)); // convert jsonld test file back to rdf format InputStream inputLD = new FileInputStream(jsonldTestFileName); OutputStream outRDF = new FileOutputStream(rdfTestFileName); - intf.convertFromJsonld(inputLD, outRDF); + converter.convertFromJsonld(inputLD, outRDF); + } + + @Test + final void test2() throws IOException { + JsonldConverter converter = new JsonldBiopaxConverter(); + // convert owl test file in resource directory to jsonld format + InputStream in = getClass().getResourceAsStream("/pc14-test.owl"); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + converter.convertToJsonld(in, baos); + String res = baos.toString("UTF-8"); + Assertions.assertAll( + () -> Assertions.assertThrows(IllegalArgumentException.class, () -> URI.create("http://")), //bad URI + () -> Assertions.assertDoesNotThrow(() -> URI.create("bioregistry.io/chebi:18367")), //valid URI but not good for LD (LinkedData) + () -> Assertions.assertDoesNotThrow(() -> URI.create("chebi:18367")), // valid URI (CURIE) + () -> Assertions.assertDoesNotThrow(() -> URI.create("http://bioregistry.io/chebi:18367")), //good valid absolute URI + () -> Assertions.assertTrue(res.contains("@id\": \"http://bioregistry.io/chebi:18367")), + () -> Assertions.assertTrue(res.contains("@id\": \"http://bioregistry.io/mi:0361")),//as long as it has 'http://' (valid abs. uri w/o schema would fail here due Jena bug) + () -> Assertions.assertTrue(res.contains("@id\": \"chebi:18367")) //unchanged + ); } } diff --git a/json-converter/src/test/resources/pc14-test.owl b/json-converter/src/test/resources/pc14-test.owl new file mode 100644 index 000000000..9da2e7fda --- /dev/null +++ b/json-converter/src/test/resources/pc14-test.owl @@ -0,0 +1,117 @@ + + + + + + + MI:0360 + mi + + + + CHEBI:14791 + chebi + + + + CHEBI:45024 + chebi + + + + Nucleus + NUCLEUS + nucleus + + + + multiple parent reference + multiple parent + + + + CHEBI:43474 + chebi + + + 0361 + mi + + + true + + + + CHEBI:7793 + chebi + + + GO:0005634 + go + + + + CHEBI:79387 + chebi + + + + secondary-ac + + + MI:0829 + mi + + + CHEBI:18367 + chebi + + + phosphate + + + + + + + + phosphate(3-) + [PO4](3-) + tetraoxophosphate(3-) + tetraoxophosphate(V) + Phosphate + Orthophosphate + PHOSPHATE ION + tetraoxidophosphate(3-) + PO4(3-) + A phosphate ion that is the conjugate base of hydrogenphosphate. + is_conjugate_base_of 43474 + + + Pathbank + Pathbank + Source http://pathbank.org/downloads/pathbank_primary_biopax.zip type: BIOPAX, Pathbank 2.0 BioPAX data (primary pathways, human data only), 16-Aug-2019 + + + + see-also + additional information + + + Phosphate + + + + + + + + CHEBI:35780 + chebi + + \ No newline at end of file diff --git a/normalizer/src/main/java/org/biopax/paxtools/normalizer/Resolver.java b/normalizer/src/main/java/org/biopax/paxtools/normalizer/Resolver.java index cdd710cf0..5a4f5fdfe 100644 --- a/normalizer/src/main/java/org/biopax/paxtools/normalizer/Resolver.java +++ b/normalizer/src/main/java/org/biopax/paxtools/normalizer/Resolver.java @@ -24,7 +24,7 @@ public class Resolver { private static Map spellmap; // compressed name -> prefix (combines custom spellmap.json and registry) private static Map synonymap;// synonym -> prefix (build from custom synonymap.json and registry) - public static final String BIOREGISTRY_IO = "bioregistry.io/"; + public static final String BIOREGISTRY_IO = "http://bioregistry.io/"; public static final String BIOREGISTRY_JSON_URL = "https://raw.githubusercontent.com/biopragmatics/bioregistry/main/exports/registry/registry.json"; @@ -183,7 +183,7 @@ public static Namespace getNamespace(String key, boolean allowVariants) { } /** - * Builds a URI of the bioentity (e.g., "bioregistry.io/go:0045202") + * Builds a URI of the bioentity (e.g., "http://bioregistry.io/go:0045202") * from the collection name/synonym and bio id. * * @param name - name, URI, or ID of a data collection (examples: "ChEBI", "go") diff --git a/normalizer/src/test/java/org/biopax/paxtools/normalizer/NormalizerTest.java b/normalizer/src/test/java/org/biopax/paxtools/normalizer/NormalizerTest.java index 210b7a674..7c4285045 100644 --- a/normalizer/src/test/java/org/biopax/paxtools/normalizer/NormalizerTest.java +++ b/normalizer/src/test/java/org/biopax/paxtools/normalizer/NormalizerTest.java @@ -56,21 +56,21 @@ private static Stream uri() { arguments("pubmed:12345", "", "pubmed", "12345", PublicationXref.class), arguments("pubmed:12345", "test/", "MEDLINE", "12345", PublicationXref.class), arguments("RX_pubmed_12345", null, "PubMED", "12345", RelationshipXref.class), //not PublicationXref - arguments("bioregistry.io/chebi:12345", "", "chebi", "CHEBI:12345", SmallMoleculeReference.class), - arguments("bioregistry.io/pubchem.substance:12345", "", "pubchem-substance", "12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/chebi:12345", "", "chebi", "CHEBI:12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/pubchem.substance:12345", "", "pubchem-substance", "12345", SmallMoleculeReference.class), //invalid chebi id (its "banana", if present, is case-sensitive; i.e., CHEBI:12345 or 12345 would match the pattern) arguments("SMR_bd1c4fd7641bf774e58bda352272c720", "", "chebi", "chebi:12345", SmallMoleculeReference.class), - arguments("bioregistry.io/chebi:12345", "test/", "chebi", "12345", SmallMoleculeReference.class), - arguments("bioregistry.io/chebi:12345", "test/", "chebi", "CHEBI:12345", SmallMoleculeReference.class), - arguments("bioregistry.io/pubchem.compound:12345", "", "pubchem", "12345", SmallMoleculeReference.class), - arguments("bioregistry.io/pubchem.substance:12345", "", "pubchem-substance", "12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/chebi:12345", "test/", "chebi", "12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/chebi:12345", "test/", "chebi", "CHEBI:12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/pubchem.compound:12345", "", "pubchem", "12345", SmallMoleculeReference.class), + arguments("http://bioregistry.io/pubchem.substance:12345", "", "pubchem-substance", "12345", SmallMoleculeReference.class), //special symbols or spaces in the 'id' part get replaced with underscore in the URI arguments("UX_Foo_Bar", null, null, "Foo Bar", UnificationXref.class), arguments("UX_Foo_Bar", null, null, "Foo&Bar", UnificationXref.class), //todo: no good - makes the same URI, can mess things up... arguments("uniprot:W0C7J9", "", "UniProt", "W0C7J9", UnificationXref.class), - arguments("bioregistry.io/ncbitaxon:9606", null, "taxonomy", "9606", BioSource.class), - arguments("bioregistry.io/ncbitaxon:9606", null, "NCBI Taxonomy", "9606", BioSource.class), - arguments("bioregistry.io/ncbitaxon:9606", null, "NEWT", "9606", BioSource.class), + arguments("http://bioregistry.io/ncbitaxon:9606", null, "taxonomy", "9606", BioSource.class), + arguments("http://bioregistry.io/ncbitaxon:9606", null, "NCBI Taxonomy", "9606", BioSource.class), + arguments("http://bioregistry.io/ncbitaxon:9606", null, "NEWT", "9606", BioSource.class), //when organism's id is not taxID (e.g., if the BioSource has tissue, cellType CVs...) arguments("BIO_taxonomy_9606_blah_blah", null, "taxonomy", "9606_blah_blah", BioSource.class) ); @@ -141,7 +141,7 @@ void normalize() { pro1.addName("nci_nature"); // must be case-insensitive (recognized) pro1.setStandardName("foo"); // must be replaced // Provenance (it won't create names from the urn unless we call: Normalizer.autoName(pro2);) - Provenance pro2 = model.addNew(Provenance.class, "bioregistry.io/signaling-gateway/"); + Provenance pro2 = model.addNew(Provenance.class, "http://bioregistry.io/signaling-gateway/"); // add some entities with props Pathway pw1 = model.addNew(Pathway.class, "pathway"); @@ -218,7 +218,7 @@ void normalize() { assertTrue(model.containsID("uniprot.isoform:W0C7J9-1")); assertTrue(model.containsID("uniprot.isoform:P68250-3")); assertTrue(model.containsID("ncbitaxon:10090")); - assertTrue(model.containsID("bioregistry.io/ncbitaxon:10090")); //was "taxonomy" + assertTrue(model.containsID("http://bioregistry.io/ncbitaxon:10090")); //was "taxonomy" // check Xref String normUri = Normalizer.uri(model.getXmlBase(), "uniprot", "P68250", UnificationXref.class); @@ -226,7 +226,7 @@ void normalize() { assertTrue(bpe instanceof UnificationXref); // check PR - bpe = model.getByID("bioregistry.io/uniprot:Q0VCL1"); + bpe = model.getByID("http://bioregistry.io/uniprot:Q0VCL1"); assertTrue(bpe instanceof ProteinReference); assertFalse(model.containsID("Xref7")); //RXs are now all normalized as well @@ -262,10 +262,10 @@ void normalize() { @Test void autoName() { Model model = BioPAXLevel.L3.getDefaultFactory().createModel(); - Provenance pro = model.addNew(Provenance.class, "bioregistry.io/pid.pathway/"); + Provenance pro = model.addNew(Provenance.class, "http://bioregistry.io/pid.pathway/"); pro.setStandardName("foo"); Normalizer.autoName(pro); - Provenance pro2 = model.addNew(Provenance.class, "bioregistry.io/signaling-gateway"); // ending / doesn't matter + Provenance pro2 = model.addNew(Provenance.class, "http://bioregistry.io/signaling-gateway"); // ending / doesn't matter Normalizer.autoName(pro2); assertAll( () -> assertTrue(pro.getName().contains("pid.pathway")), @@ -305,7 +305,7 @@ void normalize2() { Normalizer normalizer = new Normalizer(); normalizer.normalize(model); - ProteinReference e = (ProteinReference) model.getByID("bioregistry.io/uniprot:Q0VCL1"); + ProteinReference e = (ProteinReference) model.getByID("http://bioregistry.io/uniprot:Q0VCL1"); assertNotNull(e); assertEquals(4, e.getXref().size()); } @@ -331,7 +331,7 @@ void normalize3() { assertEquals(0, pr.getXref().size()); // old PR has xref removed! assertEquals(0, ref.getXrefOf().size()); // because the old xref was replaced in all parent elements! - ProteinReference e = (ProteinReference) model.getByID("bioregistry.io/uniprot:Q0VCL1"); + ProteinReference e = (ProteinReference) model.getByID("http://bioregistry.io/uniprot:Q0VCL1"); assertNotNull(e); assertEquals(1, e.getXref().size()); diff --git a/normalizer/src/test/java/org/biopax/paxtools/normalizer/ResolverTest.java b/normalizer/src/test/java/org/biopax/paxtools/normalizer/ResolverTest.java index 5d1074f26..3ab1bdab6 100644 --- a/normalizer/src/test/java/org/biopax/paxtools/normalizer/ResolverTest.java +++ b/normalizer/src/test/java/org/biopax/paxtools/normalizer/ResolverTest.java @@ -42,13 +42,15 @@ public final void checkRegExp() { public final void getURI() { Assertions.assertAll( //standard prefix and id with "banana" prefix - () -> Assertions.assertEquals("bioregistry.io/chebi:36927", Resolver.getURI("chebi", "CHEBI:36927")), + () -> Assertions.assertEquals("http://bioregistry.io/chebi:36927", Resolver.getURI("chebi", "CHEBI:36927")), //old ns prefix (should auto-fix as "chebi") and id without "CHEBI:" banana... - () -> Assertions.assertEquals("bioregistry.io/chebi:36927", Resolver.getURI("identifiers.org/chebi/", "36927")), + () -> Assertions.assertEquals("http://bioregistry.io/chebi:36927", Resolver.getURI("identifiers.org/chebi/", "36927")), //similar, but using bioregistry.io/ base, with ending slash, and with banana... - () -> Assertions.assertEquals("bioregistry.io/chebi:36927", Resolver.getURI("bioregistry.io/chebi", "CHEBI:36927")), - () -> Assertions.assertEquals("bioregistry.io/pubchem.compound:1", Resolver.getURI("CID", "1")), - () -> Assertions.assertEquals("bioregistry.io/pubchem.substance:1", Resolver.getURI("SID", "1")), + () -> Assertions.assertEquals("http://bioregistry.io/chebi:36927", Resolver.getURI("bioregistry.io/chebi", "CHEBI:36927")), + () -> Assertions.assertEquals("http://bioregistry.io/chebi:36927", Resolver.getURI("http://bioregistry.io/chebi", "CHEBI:36927")), + () -> Assertions.assertEquals("http://bioregistry.io/chebi:36927", Resolver.getURI("https://bioregistry.io/chebi", "CHEBI:36927")), + () -> Assertions.assertEquals("http://bioregistry.io/pubchem.compound:1", Resolver.getURI("CID", "1")), + () -> Assertions.assertEquals("http://bioregistry.io/pubchem.substance:1", Resolver.getURI("SID", "1")), () -> Assertions.assertNull(Resolver.getURI("compound", "1")) //id pattern mismatch (kegg.compound) ); } diff --git a/pattern/src/main/java/org/biopax/paxtools/pattern/miner/CommonIDFetcher.java b/pattern/src/main/java/org/biopax/paxtools/pattern/miner/CommonIDFetcher.java index 793f79ec9..1efb1df0a 100644 --- a/pattern/src/main/java/org/biopax/paxtools/pattern/miner/CommonIDFetcher.java +++ b/pattern/src/main/java/org/biopax/paxtools/pattern/miner/CommonIDFetcher.java @@ -48,7 +48,7 @@ else if (useUniprotIDs && (StringUtils.containsIgnoreCase(ele.getUri(),"identifiers.org/uniprot") || StringUtils.containsIgnoreCase(ele.getUri(),"bioregistry.io/uniprot"))) //can be like ...identifiers.org/uniprot:AC or identifiers.org/uniprot/AC - // or bioregistry.io/uniprot:AC or bioregistry.io/uniprot.isoform:... + // or http://bioregistry.io/uniprot:AC or bioregistry.io/uniprot.isoform:... { String ac = StringUtils.substringAfterLast(ele.getUri(), "/"); if(StringUtils.contains(ac, ":")) { diff --git a/pattern/src/test/java/org/biopax/paxtools/pattern/miner/SIFSearcherTest.java b/pattern/src/test/java/org/biopax/paxtools/pattern/miner/SIFSearcherTest.java index e73e6291f..6b503cfcd 100644 --- a/pattern/src/test/java/org/biopax/paxtools/pattern/miner/SIFSearcherTest.java +++ b/pattern/src/test/java/org/biopax/paxtools/pattern/miner/SIFSearcherTest.java @@ -150,7 +150,7 @@ public void generateSomeSIF() throws IOException // public Pattern constructPattern() // { // Pattern pattern = super.constructPattern(); -// pattern.add(new IDConstraint(Collections.singleton("bioregistry.io/uniprot:Q9NVZ3")), "upper controller ER"); +// pattern.add(new IDConstraint(Collections.singleton("http://bioregistry.io/uniprot:Q9NVZ3")), "upper controller ER"); // return pattern; // } // }; diff --git a/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java b/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java index 12cc24f7a..92b9e73fd 100644 --- a/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java +++ b/paxtools-console/src/main/java/org/biopax/paxtools/Commands.java @@ -652,8 +652,8 @@ static void summarizeHgncIds(Model model, PrintStream out) { //increment the counts by data source final String uri = ser.getUri(); for(Object provenance : pa.getValueFromBean(ser)) { - if (!StringUtils.startsWithIgnoreCase(uri, "identifiers.org/hgnc") - && !StringUtils.startsWithIgnoreCase(uri, "bioregistry.io/hgnc") + if (!StringUtils.containsIgnoreCase(uri, "identifiers.org/hgnc") + && !StringUtils.containsIgnoreCase(uri, "bioregistry.io/hgnc") && !StringUtils.containsIgnoreCase(ser.getXref().toString(), "hgnc") ) { problemErs.add(String.format("%s\t%s\t%s", @@ -709,8 +709,8 @@ static void summarizeUniprotIds(Model model, PrintStream out) { final String uri = pr.getUri(); for(Object provenance : pa.getValueFromBean(pr)) { //when the protein reference does not have any uniprot AC/ID - - if(!StringUtils.startsWithIgnoreCase(uri, "identifiers.org/uniprot") - && !StringUtils.startsWithIgnoreCase(uri, "bioregistry.io/uniprot") + if(!StringUtils.containsIgnoreCase(uri, "identifiers.org/uniprot") + && !StringUtils.containsIgnoreCase(uri, "bioregistry.io/uniprot") && !StringUtils.containsIgnoreCase(pr.getXref().toString(), "uniprot")) { problemErs.add(String.format("%s\t%s\t%s", ((Provenance) provenance).getDisplayName(), pr.getDisplayName(), uri)); @@ -760,8 +760,8 @@ static void summarizeChebiIds(Model model, PrintStream out) { } final String uri = smr.getUri(); for(Object provenance : pa.getValueFromBean(smr)) { - if(!StringUtils.startsWithIgnoreCase(uri, "identifiers.org/chebi") - && !StringUtils.startsWithIgnoreCase(uri,"bioregistry.io/chebi") + if(!StringUtils.containsIgnoreCase(uri, "identifiers.org/chebi") + && !StringUtils.containsIgnoreCase(uri,"bioregistry.io/chebi") && !StringUtils.containsIgnoreCase(smr.getXref().toString(),"chebi")) { problemErs.add(String.format("%s\t%s\t%s", ((Provenance) provenance).getDisplayName(), smr.getDisplayName(), uri)); diff --git a/paxtools-console/src/main/java/org/biopax/paxtools/examples/SimpleIOExample.java b/paxtools-console/src/main/java/org/biopax/paxtools/examples/SimpleIOExample.java index 1e2eb201e..791192c49 100644 --- a/paxtools-console/src/main/java/org/biopax/paxtools/examples/SimpleIOExample.java +++ b/paxtools-console/src/main/java/org/biopax/paxtools/examples/SimpleIOExample.java @@ -44,7 +44,7 @@ public static void main(String[] args) throws IOException { uxref.setDb("uniprot"); uxref.setId("P62158"); // using absolute (ext.) URI as id - ProteinReference prf = model2.addNew(ProteinReference.class, "bioregistry.io/uniprot:P62158"); + ProteinReference prf = model2.addNew(ProteinReference.class, "http://bioregistry.io/uniprot:P62158"); prf.setDisplayName("CALM_HUMAN"); prf.addXref(uxref); // (do not need to explicitly add objects to the model)