Codota Logo
ExportedTagSet
Code IndexAdd Codota to your IDE (free)

How to use
ExportedTagSet
in
de.tudarmstadt.ukp.clarin.webanno.export.model

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.export.model.ExportedTagSet (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

@Override
public void exportData(ProjectExportRequest aRequest, ExportedProject aExProject, File aStage)
  throws Exception
{
  List<ExportedTagSet> extTagSets = new ArrayList<>();
  for (TagSet tagSet : annotationService.listTagSets(aRequest.getProject())) {
    ExportedTagSet exTagSet = new ExportedTagSet();
    exTagSet.setCreateTag(tagSet.isCreateTag());
    exTagSet.setDescription(tagSet.getDescription());
    exTagSet.setLanguage(tagSet.getLanguage());
    exTagSet.setName(tagSet.getName());
    
    List<ExportedTag> exTags = new ArrayList<>();
    for (Tag tag : annotationService.listTags(tagSet)) {
      ExportedTag exTag = new ExportedTag();
      exTag.setDescription(tag.getDescription());
      exTag.setName(tag.getName());
      exTags.add(exTag);
    }
    exTagSet.setTags(exTags);
    extTagSets.add(exTagSet);
  }
  aExProject.setTagSets(extTagSets);
}

origin: webanno/webanno

@Deprecated
public static void createTagSet(TagSet aTagSet,
    ExportedTagSet aExTagSet, Project aProject,
    User aUser, AnnotationSchemaService aAnnotationService)
  throws IOException
{
  aTagSet.setCreateTag(aExTagSet.isCreateTag());
  aTagSet.setDescription(aExTagSet.getDescription());
  aTagSet.setLanguage(aExTagSet.getLanguage());
  aTagSet.setName(aExTagSet.getName());
  aTagSet.setProject(aProject);
  aAnnotationService.createTagSet(aTagSet);
  for (ExportedTag exTag : aExTagSet.getTags()) {
    // do not duplicate tag
    if (aAnnotationService.existsTag(exTag.getName(), aTagSet)) {
      continue;
    }
    Tag tag = new Tag();
    tag.setDescription(exTag.getDescription());
    tag.setTagSet(aTagSet);
    tag.setName(exTag.getName());
    aAnnotationService.createTag(tag);
  }
}
origin: webanno/webanno

List<String> corefRelTags = new ArrayList<>();
for (ExportedTagSet tagSet : importedTagSets) {
  switch (tagSet.getTypeName()) {
  case WebAnnoConst.POS:
    for (ExportedTag tag : tagSet.getTags()) {
      posTags.add(tag.getName());
      posTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      depTags.add(tag.getName());
      depTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      neTags.add(tag.getName());
      neTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      corefTypeTags.add(tag.getName());
    for (ExportedTag tag : tagSet.getTags()) {
      corefRelTags.add(tag.getName());
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

/**
 * Works for scenarios with overwrite enabled Checks if tagset already exists, then overwrites
 * otherwise works normally
 */
public static TagSet importTagSetFromJsonWithOverwrite(Project project,
    InputStream tagInputStream, AnnotationSchemaService aAnnotationService)
  throws IOException
{
  String text = IOUtils.toString(tagInputStream, "UTF-8");
  ExportedTagSet importedTagSet = JSONUtil.getObjectMapper().readValue(text,
      ExportedTagSet.class);
  if (aAnnotationService.existsTagSet(importedTagSet.getName(), project)) {
    // A tagset exists so we'll have to replace it
    return replaceTagSet(project, importedTagSet, aAnnotationService);
  }
  else {
    // Proceed normally
    return createTagSet(project, importedTagSet, aAnnotationService);
  }
}
origin: webanno/webanno

/**
 * Works for scenarios with overwrite enabled Checks if tagset already exists, then overwrites
 * otherwise works normally
 */
public static TagSet importTagSetFromJsonWithOverwrite(Project project,
    InputStream tagInputStream, AnnotationSchemaService aAnnotationService)
  throws IOException
{
  String text = IOUtils.toString(tagInputStream, "UTF-8");
  ExportedTagSet importedTagSet = JSONUtil.getObjectMapper().readValue(text,
      ExportedTagSet.class);
  if (aAnnotationService.existsTagSet(importedTagSet.getName(), project)) {
    // A tagset exists so we'll have to replace it
    return replaceTagSet(project, importedTagSet, aAnnotationService);
  }
  else {
    // Proceed normally
    return createTagSet(project, importedTagSet, aAnnotationService);
  }
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

List<String> corefRelTags = new ArrayList<>();
for (ExportedTagSet tagSet : importedTagSets) {
  switch (tagSet.getTypeName()) {
  case WebAnnoConst.POS:
    for (ExportedTag tag : tagSet.getTags()) {
      posTags.add(tag.getName());
      posTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      depTags.add(tag.getName());
      depTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      neTags.add(tag.getName());
      neTagDescriptions.add(tag.getDescription());
    for (ExportedTag tag : tagSet.getTags()) {
      corefTypeTags.add(tag.getName());
    for (ExportedTag tag : tagSet.getTags()) {
      corefRelTags.add(tag.getName());
origin: webanno/webanno

@Override
public void exportData(ProjectExportRequest aRequest, ExportedProject aExProject, File aStage)
  throws Exception
{
  List<ExportedTagSet> extTagSets = new ArrayList<>();
  for (TagSet tagSet : annotationService.listTagSets(aRequest.getProject())) {
    ExportedTagSet exTagSet = new ExportedTagSet();
    exTagSet.setCreateTag(tagSet.isCreateTag());
    exTagSet.setDescription(tagSet.getDescription());
    exTagSet.setLanguage(tagSet.getLanguage());
    exTagSet.setName(tagSet.getName());
    
    List<ExportedTag> exTags = new ArrayList<>();
    for (Tag tag : annotationService.listTags(tagSet)) {
      ExportedTag exTag = new ExportedTag();
      exTag.setDescription(tag.getDescription());
      exTag.setName(tag.getName());
      exTags.add(exTag);
    }
    exTagSet.setTags(exTags);
    extTagSets.add(exTagSet);
  }
  aExProject.setTagSets(extTagSets);
}

origin: de.tudarmstadt.ukp.clarin.webanno/webanno-export

@Deprecated
public static void createTagSet(TagSet aTagSet,
    ExportedTagSet aExTagSet, Project aProject,
    User aUser, AnnotationSchemaService aAnnotationService)
  throws IOException
{
  aTagSet.setCreateTag(aExTagSet.isCreateTag());
  aTagSet.setDescription(aExTagSet.getDescription());
  aTagSet.setLanguage(aExTagSet.getLanguage());
  aTagSet.setName(aExTagSet.getName());
  aTagSet.setProject(aProject);
  aAnnotationService.createTagSet(aTagSet);
  for (ExportedTag exTag : aExTagSet.getTags()) {
    // do not duplicate tag
    if (aAnnotationService.existsTag(exTag.getName(), aTagSet)) {
      continue;
    }
    Tag tag = new Tag();
    tag.setDescription(exTag.getDescription());
    tag.setTagSet(aTagSet);
    tag.setName(exTag.getName());
    aAnnotationService.createTag(tag);
  }
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

TagSet tagSet = null;
if (exTagset != null
    && annotationService.existsTagSet(exTagset.getName(), project)) {
  tagSet = annotationService.getTagSet(exTagset.getName(), project);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

ExportedTagSet exTagSet = new ExportedTagSet();
exTagSet.setDescription(tagSet.getDescription());
exTagSet.setLanguage(tagSet.getLanguage());
exTagSet.setName(tagSet.getName());
exTagSet.setTags(exportedTags);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

  private void importTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject)
    throws IOException
  {
    // aTagSet is a parameter because we want to use this also in the project settings
    // panel and have the ability there to merge imported tags into an existing tagset
    aTagSet.setCreateTag(aExTagSet.isCreateTag());
    aTagSet.setDescription(aExTagSet.getDescription());
    aTagSet.setLanguage(aExTagSet.getLanguage());
    aTagSet.setName(aExTagSet.getName());
    aTagSet.setProject(aProject);
    annotationService.createTagSet(aTagSet);

    for (ExportedTag exTag : aExTagSet.getTags()) {
      // do not duplicate tag
      if (annotationService.existsTag(exTag.getName(), aTagSet)) {
        continue;
      }
      Tag tag = new Tag();
      tag.setDescription(exTag.getDescription());
      tag.setTagSet(aTagSet);
      tag.setName(exTag.getName());
      annotationService.createTag(tag);
    }
  }
}
origin: webanno/webanno

TagSet tagSet = null;
if (exTagset != null
    && annotationService.existsTagSet(exTagset.getName(), project)) {
  tagSet = annotationService.getTagSet(exTagset.getName(), project);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
origin: webanno/webanno

ExportedTagSet exTagSet = new ExportedTagSet();
exTagSet.setDescription(tagSet.getDescription());
exTagSet.setLanguage(tagSet.getLanguage());
exTagSet.setName(tagSet.getName());
exTagSet.setTags(exportedTags);
origin: webanno/webanno

  private void importTagSet(TagSet aTagSet, ExportedTagSet aExTagSet, Project aProject)
    throws IOException
  {
    // aTagSet is a parameter because we want to use this also in the project settings
    // panel and have the ability there to merge imported tags into an existing tagset
    aTagSet.setCreateTag(aExTagSet.isCreateTag());
    aTagSet.setDescription(aExTagSet.getDescription());
    aTagSet.setLanguage(aExTagSet.getLanguage());
    aTagSet.setName(aExTagSet.getName());
    aTagSet.setProject(aProject);
    annotationService.createTagSet(aTagSet);

    for (ExportedTag exTag : aExTagSet.getTags()) {
      // do not duplicate tag
      if (annotationService.existsTag(exTag.getName(), aTagSet)) {
        continue;
      }
      Tag tag = new Tag();
      tag.setDescription(exTag.getDescription());
      tag.setTagSet(aTagSet);
      tag.setName(exTag.getName());
      annotationService.createTag(tag);
    }
  }
}
origin: webanno/webanno

TagSet tagset = annotationService.getTagSet(aExFeature.getTagSet().getName(), aProject);
aFeature.setTagset(tagset);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

ExportedTagSet exTagSet = new ExportedTagSet();
exTagSet.setDescription(tagSet.getDescription());
exTagSet.setLanguage(tagSet.getLanguage());
exTagSet.setName(tagSet.getName());
exTagSet.setCreateTag(tagSet.isCreateTag());
  exportedTags.add(exTag);
exTagSet.setTags(exportedTags);
exFeature.setTagSet(exTagSet);
origin: webanno/webanno

public static TagSet createTagSet(Project project,
    ExportedTagSet importedTagSet,
    AnnotationSchemaService aAnnotationService)
  throws IOException
{
  String importedTagSetName = importedTagSet.getName();
  if (aAnnotationService.existsTagSet(importedTagSetName, project)) {
    // aAnnotationService.removeTagSet(aAnnotationService.getTagSet(
    // importedTagSet.getName(), project));
    // Rename Imported TagSet instead of deleting the old one.
    importedTagSetName = copyTagSetName(aAnnotationService, importedTagSetName, project);
  }
  TagSet newTagSet = new TagSet();
  newTagSet.setDescription(importedTagSet.getDescription());
  newTagSet.setName(importedTagSetName);
  newTagSet.setLanguage(importedTagSet.getLanguage());
  newTagSet.setProject(project);
  newTagSet.setCreateTag(importedTagSet.isCreateTag());
  aAnnotationService.createTagSet(newTagSet);
  for (ExportedTag tag : importedTagSet.getTags()) {
    Tag newTag = new Tag();
    newTag.setDescription(tag.getDescription());
    newTag.setName(tag.getName());
    newTag.setTagSet(newTagSet);
    aAnnotationService.createTag(newTag);
  }
  
  return newTagSet;
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

TagSet tagset = annotationService.getTagSet(aExFeature.getTagSet().getName(), aProject);
aFeature.setTagset(tagset);
origin: webanno/webanno

ExportedTagSet exTagSet = new ExportedTagSet();
exTagSet.setDescription(tagSet.getDescription());
exTagSet.setLanguage(tagSet.getLanguage());
exTagSet.setName(tagSet.getName());
exTagSet.setCreateTag(tagSet.isCreateTag());
  exportedTags.add(exTag);
exTagSet.setTags(exportedTags);
exFeature.setTagSet(exTagSet);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

public static TagSet createTagSet(Project project,
    ExportedTagSet importedTagSet,
    AnnotationSchemaService aAnnotationService)
  throws IOException
{
  String importedTagSetName = importedTagSet.getName();
  if (aAnnotationService.existsTagSet(importedTagSetName, project)) {
    // aAnnotationService.removeTagSet(aAnnotationService.getTagSet(
    // importedTagSet.getName(), project));
    // Rename Imported TagSet instead of deleting the old one.
    importedTagSetName = copyTagSetName(aAnnotationService, importedTagSetName, project);
  }
  TagSet newTagSet = new TagSet();
  newTagSet.setDescription(importedTagSet.getDescription());
  newTagSet.setName(importedTagSetName);
  newTagSet.setLanguage(importedTagSet.getLanguage());
  newTagSet.setProject(project);
  newTagSet.setCreateTag(importedTagSet.isCreateTag());
  aAnnotationService.createTagSet(newTagSet);
  for (ExportedTag tag : importedTagSet.getTags()) {
    Tag newTag = new Tag();
    newTag.setDescription(tag.getDescription());
    newTag.setName(tag.getName());
    newTag.setTagSet(newTagSet);
    aAnnotationService.createTag(newTag);
  }
  
  return newTagSet;
}
de.tudarmstadt.ukp.clarin.webanno.export.modelExportedTagSet

Javadoc

All required contents of a tagset to be exported. The tagsets to be exported are those created for a project, hence project specific.

Most used methods

  • <init>
  • getName
  • setDescription
  • setLanguage
  • setName
  • setTags
  • getDescription
  • getLanguage
  • getTags
  • isCreateTag
  • setCreateTag
  • getTypeName
  • setCreateTag,
  • getTypeName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • putExtra (Intent)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Reference (javax.naming)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now