Adapters

jabiercoding edited this page May 30, 2016 · 17 revisions

C and Java source code

  • id: c or java
  • Plugin: org.but4reuse.adapters.sourcecode
  • Adaptable: A folder containing source code
  • Elements: FSTNonTerminalNode and FSTTerminalNode
  • Adapt: FeatureHouse source code visitor
  • Similarity: Feature Structure Tree (FST) positions and names comparison
  • Dependencies: FST nodes containment dependencies. Other dependencies such as Call Dependency Graphs (on-going work)
  • Construct: FeatureHouse extraction creating code fragments
  • Other: We embedded the FeatureHouse library in the adapter. No need to install.

EMF models

  • id: models
  • Plugin: org.but4reuse.adapters.emf
  • Adaptable: EMF model
  • Elements: EMFClassElement, EMFAttributeElement and EMFReferenceElement
  • Adapt: Pre-Order model traversal of containment relations
  • Similarity: EMF DiffMerge operations
  • Dependencies: Container dependency of classes, attributes and references. Referenced elements dependencies.
  • Construct: Use CVLExtractorTutorial to create CVL models. Extra plugin: org.but4reuse.adapters.emf.cvl
  • Other: Requires EMF Diff/Merge v0.3 installation. 0.3 or greater. EMF Diff/Merge v0.3 download. Related documentation can be found as research publication. Check also CVLExtractorTutorial for installing the CVL plugin.

Text lines

  • id: textlines
  • Plugin: org.but4reuse.adapters.textlines
  • Adaptable: Any file that is not a folder
  • Elements: LineElement.
  • Adapt: The file is read line by line
  • Similarity: Levenshtein distance between strings
  • Dependencies: None
  • Construct: Append the line strings to an empty file

File structure

  • id: filestructure
  • Plugin: org.but4reuse.adapters.filestructure
  • Adaptable: Any folder
  • Elements: FileElement and FolderElement (FolderElement extends FileElement)
  • Adapt: Pre-Order tree traversal of its structure
  • Similarity: Name and relative path to the initial folder. Optionally file contents based on MD5 hashing
  • Dependencies: Containment dependency
  • Construct: Copy the resources in a given destination

Images

  • id: images
  • Plugin: org.but4reuse.adapters.images
  • Adaptable: An image file in jpg, bmp, png, gif or ico format.
  • Elements: PixelElement
  • Adapt: Image pixel matrix visitor ignoring completely transparent pixels.
  • Similarity: Pixel cartesian coordinates, color and transparency.
  • Dependencies: A pixel depends on its position.
  • Construct: An image with the selected pixels.
  • Other: Check the Tutorial

Comma-Separated-Value

  • id: csv
  • Plugin: org.but4reuse.adapters.csv
  • Adaptable: A csv file
  • Elements: CellElement
  • Adapt: csv matrix visitor
  • Similarity: Cell coordinates and String comparison of the value
  • Dependencies: A cell depends on its position.
  • Construct: A csv file with the selected cells.

Requirements

Eclipse installations adapter

  • id: eclipse
  • Plugin: org.but4reuse.adapters.eclipse
  • Adaptable: Eclipse installation folder
  • Elements: PluginElement and FileElement (PluginElement extends FileElement)
  • Adapt: Eclipse folder structure visitor
  • Similarity: Plugin ids and for the rest of the files, the same as in the filestructure adapter.
  • Dependencies: Plugin required bundles. Fragments have a dependency to the plugin host. Files have a containment dependency.
  • Construct: The selected plugins and files. Adjustment of the bundles.info configuration file.

Graphs adapter

  • id: graphs
  • Plugin: org.but4reuse.adapters.graphs
  • Adaptable: A GraphML or GML file
  • Elements: VertexElement and EdgeElement
  • Adapt: Blueprints Tinkerpop graph visitor
  • Similarity: Label string similarity. The attributes used for the label can be defined in the adapter user preferences.
  • Dependencies: Vertex dependency based on the edges
  • Construct: Subgraphs creation in GraphML format
  • Other: Uses Blueprints Tinkerpop but we embedded the library in the plugin. No installation needed.

Natural language text

  • id: nltext
  • Plugin: org.but4reuse.adapters.nltext
  • Adaptable: Any file
  • Elements: SentenceElement
  • Adapt: Sentence splitter using OpenNLP library
  • Similarity: WUP natural language comparison similarity
  • Dependencies: None defined
  • Construct: A file with the selected sentences
  • Other: Uses OpenNLP but we embedded the library in the plugin. No installation needed.

Music scores

  • id: music
  • Plugin: org.but4reuse.adapters.music
  • Adaptable: MusicXML file
  • Elements: NoteElement
  • Adapt: MusicXML parser
  • Similarity: Same note position in the measure, same pitch and duration. (On-going work)
  • Dependencies: Position (On-going work)
  • Construct: A MusicXML file with the selected notes (On-going work)

JSON

  • id: json
  • Plugin: org.but4reuse.adapters.json
  • Adaptable: A JSON file
  • Elements: ObjectElement, KeyElement, ValueElement, ArrayElement, IndexArrayElement
  • Adapt: JSON parser. It adapts the JSON file as a tree.
  • Similarity: The path to the root including array indexes
  • Dependencies: The parent element
  • Construct: A JSON file

Scratch games

  • id: scratch
  • Plugin: org.but4reuse.adapters.scratch
  • Adaptable: The JSON file of the game
  • Elements: ScratchElement
  • Adapt: It uses the JSON parser internally
  • Similarity: The path to the root including array indexes
  • Dependencies: The parent element
  • Construct: A complete sb2 file with the project.json and all the needed resources (images etc.)

Android applications

Not open sourced, ask but4reuse@gmail.com

Ecore EMF models

Not open sourced, ask but4reuse@gmail.com

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.