本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.<init>()
方法的一些代码示例,展示了YElement.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.<init>()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:<init>
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-importer-speech-to-text
private YElement prepareYElement(List<Video> videosList) {
YElement yElement = new YElement();
if (videosList != null) {
Video video = videosList.get(FIRST);
try {
prepareYElementFromApi(video, yElement);
} catch(ParseException e) {
throw new GeneralBusinessException(e);
}
}
return yElement;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
public YElement extractMetadata(BxDocument document) throws AnalysisException {
Set<EnhancedField> enhancedFields = EnumSet.noneOf(EnhancedField.class);
BxModelUtils.sortZonesRecursively(document);
YElement metadata = new YElement().setId("elementId");
for (Enhancer enhancer : enhancers) {
enhancer.enhanceMetadata(document, metadata, enhancedFields);
}
return metadata;
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
protected YElement initializeYElement(final DataSet dataSet) {
YElement yElement = null;
String bwmetaXml = dataSet.getBwmetaXml();
if (StringUtils.isNotBlank(bwmetaXml)) {
List<YExportable> metadata = bwmetaDeserializer.parse(bwmetaXml, null);
yElement = YModelToolbox.retrieveFirstYElement(metadata);
} else {
yElement = new YElement();
}
return yElement;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public void removeElement(String objectId) {
super.removeElement(objectId);
repositoryFacade.deregisterElementData(objectId);
nearRealtimeCache.addObject(new YElement(objectId), NearRealtimeEntryType.DELETED);
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookSeriesElement(SeriesMetadata seriesMetadata, YElement conferenceEventElement, CrossrefIdGenerator generator) {
YElement element = new YElement();
extractSeriesMetadata(null, generator, element, seriesMetadata);
YRelation proceedingsRelation = new YRelation(RelationTypes.RL_PROCEEDINGS_OF, new YId(StringUtils.EMPTY, conferenceEventElement.getId()));
element.getRelations().add(proceedingsRelation);
return element;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-yadda
private YElement prepareYElement(String id, Properties prop) {
YElement yElement = new YElement();
yElement.setId(id);
if (!prop.getProperty("title").isEmpty()) {
yElement.addName(new YName(prepareProperty("title", prop)));
}
yElement.addDescription(new YDescription(YLanguage.Undetermined, prepareProperty("description", prop), DescriptionTypes.DS_SUMMARY));
if (!prop.getProperty("key-words").isEmpty()) {
List<String> tags = new ArrayList<String>(Arrays.asList(prepareProperty("key-words", prop).split(",")));
yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
}
if (!prop.getProperty("supplier").isEmpty()) {
yElement.addAttribute("copyright-holder", prepareProperty("supplier", prop));
}
if (!prop.getProperty("duration").isEmpty()) {
yElement.addAttribute("duration", prepareProperty("duration", prop));
}
yElement.addLanguage(YLanguage.Undetermined);
return yElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
@Override
public YElement process(Book book, YElement parent, CrossrefIdGenerator generator) {
BookSeriesMetadata bookSeriesMetadata = book.getBookSeriesMetadata();
YElement element = new YElement();
if (StringUtils.isNotBlank(bookSeriesMetadata.getLanguage())) {
element.addLanguage(YLanguage.byCode(bookSeriesMetadata.getLanguage()));
}
SeriesMetadata seriesMetadata = bookSeriesMetadata.getSeriesMetadata();
extractSeriesMetadata(parent, generator, element, seriesMetadata);
return element;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
public List<YElement> create(PublicationMeta meta, String hierarchyId, YLanguage defaultLanguage, List<YElement> ancestors) {
List<YElement> elements = new ArrayList<YElement>();
List<YElement> localAncestors = new ArrayList<>(ancestors);
StructureBuilder builder = this.getSynchronized(builders::get, this::registerBuilder, hierarchyId);
for (YStructure structure = builder.build(meta, localAncestors); structure != null; structure = builder.build(meta, localAncestors)) {
YElement element = new YElement();
element.addStructure(structure);
elements.add(element);
Collection<PublicationMetadataParser> parsers = this.<String, Collection<PublicationMetadataParser>> getSynchronized(mappedParsers::get,
this::registerParsers, structure.getCurrent().getLevel());
for (PublicationMetadataParser parser : parsers) {
YLanguage pmLanguage = YLanguage.byCode(meta.getXmlLang(), defaultLanguage);
parser.parseMetadata(element, meta, pmLanguage, localAncestors);
}
localAncestors.add(element);
}
return elements;
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private YElement buildElement(HierarchyLevel hierarchyLevel, String elementLevel, String parentId,
String parentLevel, String parentName) {
final String elementId = hierarchyLevel.getId();
final String name = hierarchyLevel.getName();
YElement element = new YElement(elementId);
element.setNames(Lists.newArrayList(new YName(name)));
final YStructure yStructure = new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
yStructure.setCurrent(new YCurrent(elementLevel));
final YAncestor parent = new YAncestor(parentLevel, parentId);
parent.addName(new YName(parentName));
yStructure.addAncestor(parent);
element.setStructures(Lists.newArrayList(yStructure));
return element;
}
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
/**
* Creates yElement object and sets two things: UID &
* ZentralBlattIdentifier.
*
* @param src
* @return
* @throws TransformationException
*/
private YElement initArticle(ZentralBlattRecord src) {
YElement yelement = new YElement();
if (src.hasField(ZentralBlattRecord.ID_FIELD_NAME)) {
YId zblId = new YId(YConstants.EXT_SCHEME_ZBL, extractZBLId(src));
yelement.addId(zblId);
}
yelement.setId(generateUidOfZblId(yelement, ""));
return yelement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildVolumeElementFromSeries(ProceedingsSeriesMetadata proceedingsSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookVolumeElement = new YElement();
bookVolumeElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_VOLUME));
bookVolumeElement.addName(new YName(proceedingsSeriesMetadata.getVolume()));
String id = generator.generateBookVolumeId(parent.getId(), proceedingsSeriesMetadata.getVolume());
bookVolumeElement.setId(id);
return bookVolumeElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
@Override
public YElement process(Book book, YElement parent, CrossrefIdGenerator generator) {
BookSetMetadata bookSetMetadata = book.getBookSetMetadata();
YElement element = new YElement();
SetMetadata setMetadata = bookSetMetadata.getSetMetadata();
List<YName> setNames = convertTitles(setMetadata.getTitles());
element.getIds().addAll(convertIsbns(setMetadata.getIsbns()));
element.getNames().addAll(setNames);
String id = generator.generateBookSetId(element.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), getDefaultName(element));
element.setId(id);
element.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_SERIES));
if (StringUtils.isNotBlank(bookSetMetadata.getLanguage())) {
element.addLanguage(YLanguage.byCode(bookSetMetadata.getLanguage()));
}
return element;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookMetadata(BookMetadata bookMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookMetadata.getIsbns()));
if (bookMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookSetMetadata(BookSetMetadata bookSetMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookSetMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookSetMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookSetMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookSetMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookSetMetadata.getIsbns()));
if (bookSetMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookSetMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookSeriesMetadata(BookSeriesMetadata bookSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookSeriesMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookSeriesMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookSeriesMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookSeriesMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookSeriesMetadata.getIsbns()));
if (bookSeriesMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookSeriesMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildChapterElementFromPaper(ConferencePaper conferencePaper, YElement parent, CrossrefIdGenerator generator) {
YElement chapterElement = new YElement();
YStructure structure = buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_CHAPTER);
chapterElement.addStructure(structure);
chapterElement.getNames().addAll(convertTitles(conferencePaper.getTitles()));
chapterElement.getContributors().addAll(convert(conferencePaper.getContributors(), chapterElement));
chapterElement.getDates().addAll(convertDates(conferencePaper.getPublicationDates()));
chapterElement.getRelations().addAll(convertCitationList(conferencePaper.getCitationList()));
if (conferencePaper.getDoiData() != null) {
chapterElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, conferencePaper.getDoiData().getDoi()));
}
updatePages(conferencePaper.getPages(), structure.getCurrent());
String id = generator.generateBookPartId(parent.getId(), "chapter", chapterElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
getDefaultName(chapterElement));
chapterElement.setId(id);
return chapterElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookElementFromSeries(ProceedingsSeriesMetadata proceedingsSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().add(new YName(proceedingsSeriesMetadata.getProceedingsTitle()));
bookElement.getDates().addAll(convertDates(proceedingsSeriesMetadata.getPublicationDates()));
bookElement.getIds().addAll(convertIsbns(proceedingsSeriesMetadata.getIsbns()));
if (StringUtils.isNotBlank(proceedingsSeriesMetadata.getProceedingsSubject())) {
YName subject = new YName(proceedingsSeriesMetadata.getProceedingsSubject());
subject.setType(NameTypes.NM_SUBTITLE);
bookElement.addName(subject);
}
if (proceedingsSeriesMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, proceedingsSeriesMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildVolumeElement(JournalIssue journalIssue, YElement parentElement, CrossrefIdGenerator generator) {
if (journalIssue == null || journalIssue.getJournalVolume() == null || journalIssue.getJournalVolume().getVolume() == null) {
return null;
}
String volume = journalIssue.getJournalVolume().getVolume();
YElement volumeElement = new YElement();
YStructure structure = buildStructureFromParent(parentElement, HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
volumeElement.addStructure(structure);
volumeElement.addName(new YName(volume));
if (StringUtils.isBlank(journalIssue.getIssue())) {
volumeElement.getContributors().addAll(convert(journalIssue.getContributors(), volumeElement));
volumeElement.getDates().addAll(convertDates(journalIssue.getPublicationDates()));
}
String journalId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
String yearId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
String volumeId = generator.generateJournalVolumeId(yearId, journalId, volume);
volumeElement.setId(volumeId);
return volumeElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildIssueElement(JournalIssue journalIssue, YElement parentElement, CrossrefIdGenerator generator) {
if (journalIssue == null) {
return null;
}
String issue = journalIssue.getIssue();
if (issue == null) {
return null;
}
YElement issueElement = new YElement();
YStructure structure = buildStructureFromParent(parentElement, HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE);
issueElement.addStructure(structure);
issueElement.getContributors().addAll(convert(journalIssue.getContributors(), issueElement));
issueElement.getDates().addAll(convertDates(journalIssue.getPublicationDates()));
issueElement.addName(new YName(issue));
String journalId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
String yearId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
String volumeId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
String issueId = generator.generateJournalIssueId(volumeId, yearId, journalId, issue);
issueElement.setId(issueId);
return issueElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
@Override
public YElement process(Book book, YElement parent, CrossrefIdGenerator generator) {
BookSeriesMetadata bookSeriesMetadata = book.getBookSeriesMetadata();
String id = generator.generateBookVolumeId(parent.getId(), bookSeriesMetadata.getVolume());
YElement element = new YElement();
element.setId(id);
element.addName(new YName(bookSeriesMetadata.getVolume()));
YStructure structure = new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK);
YCurrent current = new YCurrent(HierarchyWithLevelIds.EXT_LEVEL_BOOK_VOLUME);
structure.setCurrent(current);
structure.getAncestors().addAll(parent.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK).getAncestors());
element.addStructure(structure);
return element;
}
内容来源于网络,如有侵权,请联系作者删除!