本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.getAttributes()
方法的一些代码示例,展示了YElement.getAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.getAttributes()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:getAttributes
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean shouldImpactFactorBeAdded(HarvestingResult harvestingResult, YElement element) {
if (!properties.contains(Property.HARVEST_IMPACT_FACTOR)) {
return false;
}
if (null == harvestingResult.getImpactFactor()) {
return false;
}
if (!element.getAttributes(YModelUtils.IMPACT_FACTOR).isEmpty()) {
return false;
}
return true;
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean hasClassification(YElement element) {
if ( ! element.getAttributes(AT_CLASSIFICATION_OECD_BY).isEmpty()) {
return true;
}
return hasClassification(element, OECD_CLASSIFICATION);
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean shouldFrequencyBeAdded(HarvestingResult harvestingResult, YElement element) {
if (!properties.contains(Property.HARVEST_FREQUENCY)) {
return false;
}
if (StringUtils.isEmpty(harvestingResult.getFrequency())) {
return false;
}
if (!element.getAttributes(YModelUtils.FREQUENCY).isEmpty()) {
return false;
}
return true;
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private List<YAttribute> removeDocumentTypeAttribute() {
List<YAttribute> yAttributes = new ArrayList<>();
for (YAttribute yAttr : safe(article.getAttributes())) {
if(!yAttr.getKey().equals(CS.DOCUMENT_TYPE)) {
yAttributes.add(yAttr);
}
}
return yAttributes;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public void transfer(Iterator<String> iter) throws YaddaException {
while (iter.hasNext()) {
String data = iter.next();
Object t = bwmetaReader.read(data, null);
List a;
if (t instanceof List) {
a = (List) t;
} else {
a = new ArrayList();
a.add(t);
}
for (Object tmp : a) {
List<Statements> statements = Collections.emptyList();
if (tmp instanceof YElement) {
YElement ye = (YElement) tmp;
ye.getAttributes(YConstants.EXT_SCHEME_ZBL);
}
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements, YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
if (articles.size() == 0) {
return null;
}
if (articles.size() > 1) {
log.error("More than one article found in package of yelements!");
}
YElement article = articles.get(0);
List<YAttribute> attrs = article.getAttributes(YConstants.AT_ZBL_LANG_DESCRIPTION);
if (attrs==null || attrs.size() == 0) {
return null;
}
return YElementsParsingToolbox.removeEmptyValues(attrs.get(0).getValue());
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> journals = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements,
YConstants.EXT_LEVEL_JOURNAL_JOURNAL);
if (journals.size() == 0) {
return null;
}
if (journals.size() > 1) {
log.error("More than one journal found in package of yelements!");
}
YElement journal = journals.get(0);
List<YAttribute> fingerprints = journal.getAttributes(YConstants.AT_ZBL_JOURNAL_FINGERPRINT);
for (YAttribute fingerprint : fingerprints) {
if (fingerprint != null) {
return (fingerprint.getValue());
}
}
return null;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
fw.write("Czytam obiekt o id: "+ye.getId());
fw.write("Powyższego obiektu id zlbowe to: "+ye.getId(YConstants.EXT_SCHEME_ZBL));
if(!ye.getAttributes(YConstants.EXT_SCHEME_ZBL).isEmpty()){
fw.write("Znalazlem atrybuty EXT_SCHEME_ZBL");
for(YAttribute ya : ye.getAttributes(YConstants.EXT_SCHEME_ZBL))
fw.write(ya.getValue()+"\n");
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
void compare(YElement expected, YElement actual, EvalResult result) {
List<YAttribute> expAttributes = expected.getAttributes();
Map<String, List<String>> actAttMap = new HashMap<String, List<String>>();
for (YAttribute yatt : actual.getAttributes()) {
String key = yatt.getKey();
if (actAttMap.get(key) == null) {
actAttMap.put(key, new ArrayList<String>());
}
actAttMap.get(key).add(yatt.getValue());
}
for (YAttribute yatt : expAttributes) {
String key = yatt.getKey();
if (actAttMap.containsKey(key)) {
if (actAttMap.get(key).contains(yatt.getValue())) {
result.append(key, ResultStatus.RECOGNIZED, 1);
} else {
result.append(key, ResultStatus.FAILED, 1);
}
//actAttMap.remove(key);
} else {
result.append(key, ResultStatus.FAILED, 1);
}
}
for (String key : actAttMap.keySet()) {
result.append(key, ResultStatus.REDUNDANT, 1);
}
}
},
代码示例来源:origin: pl.edu.icm.yadda/yadda-cli
static Pair<String,String> journalArticleIdFromPath(YElement el) {
List <YAttribute> atts=el.getAttributes(CommonAttributeTypes.AT_SOURCE_ID);
if (!atts.isEmpty()) {
String[] sources=atts.get(0).getValue().split("/");
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
List<String> ids = element.getIds(idSchema);
if (ids.isEmpty()) {
List<YAttribute> attributes = element.getAttributes(idSchema);
if (!attributes.isEmpty()) {
if (attributes.size() == 1) {
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
result.put(AVAILABILITY, detailsFilter.filter(getAvailabilityCode(availabilityValue), InputType.IDENTIFIER, filteringContext));
for (YAttribute a : element.getAttributes()) {
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public DataResponse apply(YElement input) {
ZipFile zipFile = processorState.getZipFile();
ZipEntry lastEntry = processorState.getLastZipEntry();
YAttribute attribute = new YAttribute(CommonExtractorContstants.SOURCE_ATTRIBUTE, zipFile.getName() + "/" + lastEntry.getName());
input.getAttributes().add(attribute);
DataResponse dataResponse = new DataResponse(input, dataResponseQualityComparator);
for (YContentFile file : createIterable(input.getContents())) {
String id = file.getId();
String fileName = file.getLocations().get(0);
ZipEntry entry = zipFile.getEntry(fileName);
if (entry != null) {
dataResponse.addContent(id, new ZipEntryResource(zipFile.getName(), entry));
}
}
if(insertSource){
dataResponse.addContent(CommonExtractorContstants.SOURCE_ATTRIBUTE, new ZipEntryResource(zipFile.getName(), lastEntry));
}
return dataResponse;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private void updateJournalIds(YElement element){
String eudmlId=null;
if (StringUtils.isNotBlank(element.getId())){
eudmlId=element.getId();
}
String pmid=null;
if (element.getIds(IdSchemaIds.EXT_SCHEME_PMID).size()>0) {
pmid=element.getIds(IdSchemaIds.EXT_SCHEME_PMID).get(0);
}
String issn=null;
if (element.getIds(IdSchemaIds.EXT_SCHEME_ISSN).size()>0) {
issn=element.getIds(IdSchemaIds.EXT_SCHEME_ISSN).get(0);
}
String publisherId=null;
if (element.getIds("bwmeta1.id-class.publisher-id").size()>0) {
publisherId=element.getIds("bwmeta1.id-class.publisher-id").get(0);
}
if (publisherId==null) {
List<YAttribute> list = element.getAttributes("bwmeta1.id-class.publisher-id");
if (!list.isEmpty()) {
YAttribute at = list.get(0);
publisherId = (at == null ? null : at.getValue());
}
}
element.setId(getIdGenerator().getJournalId(pmid, issn, eudmlId,publisherId,element.getFirstName()==null?null:element.getFirstName().getText()));
}
内容来源于网络,如有侵权,请联系作者删除!