Package net.bioclipse.managers
Class WikidataManager
java.lang.Object
net.bioclipse.managers.WikidataManager
- All Implemented Interfaces:
IBactingManager
,net.bioclipse.managers.business.IBioclipseManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoi()
Lists the DOIs of the articles associated to this manager.getEntityID
(String doi) Return a work with the given DOI, or throws an BioclipseException when it does not exist.getEntityID
(net.bioclipse.inchi.InChI inchi) Returns the Wikidata entity ID for the molecule with the given InChI.getEntityIDs
(List<net.bioclipse.inchi.InChI> inchis) Returns the Wikidata entity IDs for the molecules with the given InChIs.getEntityIDsForDOIs
(List<String> dois) Returns the Wikidata entity IDs for the works with the given DOIs.getEntityIDsForType
(String type) Returns the Wikidata entity IDs for entities instance of a certain type (P31).net.bioclipse.core.domain.IMolecule
getMolecule
(net.bioclipse.inchi.InChI inchi) Return a molecule with the given InChI, or throws an BioclipseException when it does not exist.boolean
hasMolecule
(net.bioclipse.inchi.InChI inchi) Return true if Wikidata contains a molecule with the given InChI.boolean
isValidQIdentifier
(String identifier) Determines if an identifier is a valid Wikidata entity identifier, like Q5.
-
Constructor Details
-
WikidataManager
Creates a newWikidataManager
.- 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
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
Determines if an identifier is a valid Wikidata entity identifier, like Q5.- Parameters:
identifier
- to test- Returns:
- true, if the identifier is valid
-
getManagerName
- Specified by:
getManagerName
in interfacenet.bioclipse.managers.business.IBioclipseManager
-
doi
Description copied from interface:IBactingManager
Lists the DOIs of the articles associated to this manager.- Specified by:
doi
in interfaceIBactingManager
- Returns:
- a
List
of String with DOIs
-