use of org.vcell.util.document.Identifiable in project vcell by virtualcell.
the class MIRIAMAnnotationViewer method printResourceMappings.
public static String printResourceMappings(VCMetaData metaData) {
StringBuffer strBuffer = new StringBuffer();
strBuffer.append("\n\n ResourceMappings : \n");
Set<Registry.Entry> entrySet = metaData.getRegistry().getAllEntries();
for (Registry.Entry entry : entrySet) {
Resource resource = entry.getResource();
if (resource != null) {
strBuffer.append(resource.stringValue());
Identifiable identifiable = entry.getIdentifiable();
strBuffer.append(" ============= " + metaData.getIdentifiableProvider().getVCID(identifiable).toASCIIString());
strBuffer.append("\n");
}
}
return strBuffer.toString();
}
use of org.vcell.util.document.Identifiable in project vcell by virtualcell.
the class MiriamTreeModel method annotationChanged.
public void annotationChanged(AnnotationEvent annotationEvent) {
Identifiable identifiable = annotationEvent.getIdentifiable();
// if identifiable is not null, then we can repair just the subtree for that identifiable
createTree();
fireTreeStructureChanged(this, getPathToRoot(((DefaultMutableTreeNode) getRoot())), null, null);
}
use of org.vcell.util.document.Identifiable in project vcell by virtualcell.
the class VCMetaDataMiriamManager method getDublinCoreDateMap.
// this is not yet cached.
public Map<Identifiable, Map<DateQualifier, Set<DublinCoreDate>>> getDublinCoreDateMap() {
Map<Identifiable, Map<DateQualifier, Set<DublinCoreDate>>> map = new HashMap<Identifiable, Map<DateQualifier, Set<DublinCoreDate>>>();
Set<Entry> allEntries = vcMetaData.getRegistry().getAllEntries();
Graph rdfData = vcMetaData.getRdfData();
for (Entry entry : allEntries) {
Resource resource = entry.getResource();
if (resource != null) {
Identifiable identifiable = entry.getIdentifiable();
Map<DateQualifier, Set<DublinCoreDate>> qualifierDateMap = new HashMap<DateQualifier, Set<DublinCoreDate>>();
for (DublinCoreQualifier.DateQualifier dateQualifier : AnnotationQualifiers.DC_date_all) {
Set<DublinCoreDate> dateStrings = new HashSet<DublinCoreDate>();
Iterator<Statement> stmtIter = rdfData.match(resource, dateQualifier.getProperty(), null);
while (stmtIter.hasNext()) {
Statement statement = stmtIter.next();
Value dateObject = statement.getObject();
if (dateObject instanceof Literal) {
Literal dateLiteral = (Literal) dateObject;
String dateString = dateLiteral.stringValue();
dateStrings.add(new DublinCoreDate(dateString));
}
}
if (!dateStrings.isEmpty()) {
qualifierDateMap.put(dateQualifier, dateStrings);
}
}
if (!qualifierDateMap.isEmpty()) {
map.put(identifiable, qualifierDateMap);
}
}
}
return map;
}
use of org.vcell.util.document.Identifiable in project vcell by virtualcell.
the class AnnotationMapping method getRefInfo.
private HashMap<String, String> getRefInfo(BioModel bioModel, Identifiable identifiable) {
HashMap<String, String> info = new HashMap<String, String>();
VCMetaData vcMetaData = bioModel.getVCMetaData();
MiriamManager miriamManager = vcMetaData.getMiriamManager();
TreeMap<Identifiable, Map<MiriamRefGroup, MIRIAMQualifier>> miriamDescrHeir = miriamManager.getMiriamTreeMap();
Map<MiriamRefGroup, MIRIAMQualifier> refGroupMap = miriamDescrHeir.get(identifiable);
if (refGroupMap != null) {
for (MiriamRefGroup refGroup : refGroupMap.keySet()) {
MIRIAMQualifier qualifier = refGroupMap.get(refGroup);
String[] quaTemp = qualifier.toString().split("/");
String bioQualifier = quaTemp[quaTemp.length - 1];
bioQualifier = bioQualifier.substring(0, bioQualifier.length() - 1);
for (MiriamResource miriamResource : refGroup.getMiriamRefs()) {
String refSource = miriamResource.getMiriamURN();
String[] temp = refSource.split(":");
String sourceInfo = temp[2] + ":" + bioQualifier;
String refId = miriamResource.getIdentifier();
info.put(refId, sourceInfo);
// System.out.println(refId + "*********" + sourceInfo);
}
}
}
return info;
}
Aggregations