Tabnine Logo
Record.getUnique
Code IndexAdd Tabnine to your IDE (free)

How to use
getUnique
method
in
eu.fbk.knowledgestore.data.Record

Best Java code snippets using eu.fbk.knowledgestore.data.Record.getUnique (Showing top 3 results out of 315)

origin: eu.fbk.knowledgestore/ks-server

private Map<URI, Record> extractRelated(final Record record) throws Throwable {
  // TODO: this has to be done better using some Schema object
  final URI id = record.getID();
  final URI type = record.getSystemType();
  final Map<URI, Record> map = Maps.newHashMap();
  if (type.equals(KS.RESOURCE)) {
    for (final URI mentionID : record.get(KS.HAS_MENTION, URI.class)) {
      map.put(mentionID, Record.create(mentionID, KS.MENTION).add(KS.MENTION_OF, id));
    }
  } else if (type.equals(KS.MENTION)) {
    final URI resourceID = record.getUnique(KS.MENTION_OF, URI.class);
    if (resourceID != null) {
      map.put(resourceID, Record.create(resourceID, KS.RESOURCE).add(KS.HAS_MENTION, id));
    }
  } else {
    // TODO: handle entities, axioms and contexts
    throw new Error("Unexpected type: " + type);
  }
  return map;
}
origin: eu.fbk.knowledgestore/ks-server

final Record metadata = resource.getUnique(KS.STORED_AS, Record.class);
if (metadata == null) {
  return null;
final String fileName = metadata.getUnique(NFO.FILE_NAME, String.class);
check(fileName != null, null, resourceID, "No filename stored for resource (!)");
final String fileTypeString = metadata.getUnique(NIE.MIME_TYPE, String.class);
if (mimeTypes != null) {
  check(fileTypeString != null, Status.ERROR_NOT_ACCEPTABLE, resourceID,
      Data.mimeTypeToExtensions(transformToType), "bin");
  final String name = MoreObjects.firstNonNull(
      metadata.getUnique(NFO.FILE_NAME, String.class, null), "download")
      + "." + ext;
  stream = transform(fileTypeString, transformToType, stream);
  meta.set(NIE.MIME_TYPE, transformToType);
  meta.set(NFO.FILE_NAME, name);
  meta.set(NFO.FILE_LAST_MODIFIED, metadata.getUnique(NFO.FILE_LAST_MODIFIED));
  return representation;
origin: eu.fbk.knowledgestore/ks-server

final Record oldMetadata = resource.getUnique(KS.STORED_AS, Record.class);
  final Record metadata = representation.getMetadata();
  metadata.setID(Data.getValueFactory().createURI(resourceID + "_file"));
  fileName = metadata.getUnique(NFO.FILE_NAME, String.class);
  String fileType = metadata.getUnique(NIE.MIME_TYPE, String.class);
  if (fileType != null) {
    try {
  deleteFileQuietly(oldMetadata.getUnique(NFO.FILE_NAME, String.class));
eu.fbk.knowledgestore.dataRecordgetUnique

Popular methods of Record

  • encode
  • getID
  • add
  • create
  • decode
  • get
  • getProperties
  • getSystemType
  • hash
  • isNull
  • remove
  • retain
  • remove,
  • retain,
  • set,
  • setID,
  • toString

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • BoxLayout (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now