Class WikidataManager

java.lang.Object
net.bioclipse.managers.WikidataManager
All Implemented Interfaces:
IBactingManager, net.bioclipse.managers.business.IBioclipseManager

public class WikidataManager extends Object implements IBactingManager
Bioclipse manager that provides functionality around the Resource Description Framework standard. It allows creating in memory and on disk triple stores, creating on content, and IO functionality.
  • Constructor Details

    • WikidataManager

      public WikidataManager(String workspaceRoot)
      Creates a new WikidataManager.
      Parameters:
      workspaceRoot - location of the workspace, e.g. "."
  • Method Details

    • hasMolecule

      public boolean hasMolecule(net.bioclipse.inchi.InChI inchi) throws net.bioclipse.core.business.BioclipseException
      Return true if Wikidata contains a molecule with the given InChI.
      Parameters:
      inchi - InChI of the molecule to check if it already exists in Wikidata
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getEntityID

      public String getEntityID(net.bioclipse.inchi.InChI inchi) throws net.bioclipse.core.business.BioclipseException
      Returns the Wikidata entity ID for the molecule with the given InChI.
      Parameters:
      inchi - InChI of the molecule to return Wikidata ID for
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getEntityIDs

      public Map<String,String> getEntityIDs(List<net.bioclipse.inchi.InChI> inchis) throws net.bioclipse.core.business.BioclipseException
      Returns the Wikidata entity IDs for the molecules with the given InChIs.
      Parameters:
      inchis - List of InChIs of the molecules to check if they already exists in Wikidata
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getMolecule

      public net.bioclipse.core.domain.IMolecule getMolecule(net.bioclipse.inchi.InChI inchi) throws net.bioclipse.core.business.BioclipseException
      Return a molecule with the given InChI, or throws an BioclipseException when it does not exist.
      Parameters:
      inchi - InChI of the molecule to check if it already exists in Wikidata
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getEntityID

      public String getEntityID(String doi) throws net.bioclipse.core.business.BioclipseException
      Return a work with the given DOI, or throws an BioclipseException when it does not exist.
      Parameters:
      doi - DOI of the work to check if it already exists in Wikidata
      Returns:
      a String with the Q-id
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getEntityIDsForDOIs

      public Map<String,String> getEntityIDsForDOIs(List<String> dois) throws net.bioclipse.core.business.BioclipseException
      Returns the Wikidata entity IDs for the works with the given DOIs.
      Parameters:
      dois - List of DOIs of the works to check if they already exists in Wikidata
      Throws:
      net.bioclipse.core.business.BioclipseException
    • getEntityIDsForType

      public List<String> getEntityIDsForType(String type) throws net.bioclipse.core.business.BioclipseException
      Returns the Wikidata entity IDs for entities instance of a certain type (P31).
      Parameters:
      type - identifier of a Wikidata item
      Throws:
      net.bioclipse.core.business.BioclipseException
    • isValidQIdentifier

      public boolean isValidQIdentifier(String identifier)
      Determines if an identifier is a valid Wikidata entity identifier, like Q5.
      Parameters:
      identifier - to test
      Returns:
      true, if the identifier is valid
    • getManagerName

      public String getManagerName()
      Specified by:
      getManagerName in interface net.bioclipse.managers.business.IBioclipseManager
    • doi

      public List<String> doi()
      Description copied from interface: IBactingManager
      Lists the DOIs of the articles associated to this manager.
      Specified by:
      doi in interface IBactingManager
      Returns:
      a List of String with DOIs