Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Lyo/tools"

< Lyo
m (Example Checker Tool)
m (Example Checker Tool)
 
Line 5: Line 5:
 
* '''Description''': this Java tool detects common problems in the rdf resource file created by the developer.  
 
* '''Description''': this Java tool detects common problems in the rdf resource file created by the developer.  
 
* '''Input''': input file format could be "RDF/XML", "N-TRIPLE", "TURTLE" (or "TTL") and "N3". For example, instance1.rdf.
 
* '''Input''': input file format could be "RDF/XML", "N-TRIPLE", "TURTLE" (or "TTL") and "N3". For example, instance1.rdf.
* '''Output''': problems highlighted either as warning or error. For example:
+
* '''Output''': the problematic areas are highlighted either as warning or error. For example:
 
** Error: "http://open-services.net/ns/auto#ParameterDefinition" is not accessible via GET, or its content does not contain the URI as would be expected in a RDFS vocabulary document.
 
** Error: "http://open-services.net/ns/auto#ParameterDefinition" is not accessible via GET, or its content does not contain the URI as would be expected in a RDFS vocabulary document.
 
** Warning: Suspicious usage of: <rdf:type rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
 
** Warning: Suspicious usage of: <rdf:type rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>

Latest revision as of 10:35, 27 August 2014

Overview

Resource Table Tool

Example Checker Tool

  • Targeted audience: the developers who work on linked data related project
  • Description: this Java tool detects common problems in the rdf resource file created by the developer.
  • Input: input file format could be "RDF/XML", "N-TRIPLE", "TURTLE" (or "TTL") and "N3". For example, instance1.rdf.
  • Output: the problematic areas are highlighted either as warning or error. For example:

Building and Running the tools in Eclipse

Prerequisites

  • Eclipse 3.6 or higher IDE
  • EGit team provider for git (recommended) or git command line package.
  • m2eclipse for Maven support in the Eclipse IDE
  • LDP impl requires a Java 1.6 compiler and Java 1.6 runtime. The Eclipse project settings have been set appropriately. If you are building outside of Eclipse, please use Java 1.6.

Clone the Lyo git repositories

This example assumes EGit is being used

  • On the Branch Selection page, select the master branch
  • On the Local Destination page, specify a location or accept the default and click Finish

The repository should now show up in your Git Repositories view

Import the project from the git repository

  • In the Git Repositories view, right click org.eclipse.lyo.docs and select Import Projects
  • Select the Import Existing Projects wizard and click next
  • Select the projects:
    • org.eclipse.lyo.docs.org.eclipse.lyo.examplechecker
    • org.eclipse.lyo.docs.org.eclipse.lyo.resourcetable
    • org.eclipse.lyo.docs.org.eclipse.lyo.tools.common

Build all projects

To build the projects.

  • Expand the org.eclipse.lyo.docs.org.eclise.lyo.examplecheker project
  • Right click pom.xml -> Run As -> Maven clean
  • Right click pom.xml -> Run As -> Maven install
  • Expand the org.eclipse.lyo.docs.org.eclise.lyo.resourcetable project
  • Right click pom.xml -> Run As -> Maven clean
  • Right click pom.xml -> Run As -> Maven install
  • Expand the org.eclipse.lyo.docs.org.eclise.lyo.tools.common project
  • Right click pom.xml -> Run As -> Maven clean
  • Right click pom.xml -> Run As -> Maven install
  • IBM JVM/JRE Users: There is an issue with m2eclipse and the the IBM JRE. If you have see the error java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder when running a Maven install, you need to copy a newer slf4j api jar into your JRE directory to work around the issue until it is fixed:

Run the tools

Run the resource shape tool

Run the example checker tool

Run from Eclipse

Find the file CheckExample.java in the package explorer, right click, select Run As -> Java Application. This application expects one of the following arguments:

  • path to a local file
  • path to a local directory that contains a couple of files
  • URL to a remote file

Invoke example checker API from another application

CheckExample.java file also provide the following APIs:

  • ArrayList<ClassifiedErrorMessage> runExampleChecker(InputStream in, String inFormat, ArrayList<String> hostsSuppressedForURLCheck)
  • ArrayList<ClassifiedErrorMessage> runExampleChecker(Model in, ArrayList<String> hostsSuppressedForURLCheck)
  • ArrayList<String> runExampleCheckerAndReturnString(InputStream in, String inFormat, ArrayList<String> hostsSuppressedForURLCheck)
  • ArrayList<String> runExampleCheckerAndReturnString(Model in, ArrayList<String> hostsSuppressedForURLCheck)

Building and Running the tools from Command Line

Back to the top