Skip to content

Use extracted metadata in programs

Andruid Kerne edited this page May 29, 2014 · 1 revision

Extract metadata from a URL

The most basic use of BigSemantics is to extract one metadata object from a given URL. This is done in 4 steps:

  • Create a SemanticsSessionScope, which will encompass all the information that is needed by BigSemantics to accomplish the task, such as wrappers, generated class definitions for metadata types, parsers, and download monitors.
  • Create an empty Document object using the SemanticsSessionScope object, with the given URL.
  • Set up a callback function to process the extracted metadata object.
  • Queue the Document object for downloading, and BigSemantics will call the callback function after downloading, parsing, and extracting semantic data from the URL.
The ExampleOne class illustrates the above steps in Java.

Access wrapper information for extracted metadata

BigSemantics supports encoding meta-information into wrappers, that can be used by the collection representation application at runtime. For example, you can specify how a metadata field should be styled (bold, colored, font size increased, hyperlinked, ...) in the wrapper, and use this information for every extracted metadata object using that wrapper at runtime. Besides, when you want to change the style, you can simply update the wrapper without modifying the application code.

To facilitate this usage, with BigSemantics, each extracted metadata object holds a reference to its corresponding meta-metadata (the wrapper that was used to extract this metadata object). Program can use the getMetaMetadata() method to access wrapper information.