PML API (Project)

From Inference Web

(Redirected from PML API)
Jump to: navigation, search
Infobox (Project) edit with form
  • modified: 2011-5-19

internal

PML API is a JAVA API for managing PML data. The current release of PML API is available at the following links. The differences among these options are discussed below.

  1. PML library - http://inference-web.org/downloads/pml.jar
  2. PML source - http://inference-web.org/downloads/pml_source.tar
  3. PML distribution - http://inference-web.org/downloads/pml_distribution.tar.gz

Tool by Cynthia

Contents

Documentation

Differences among library, source, and distribution

Library

The library jar is just the pml.jar containing the compiled java. This goes onto your CLASSPATH and is needed to compile and run any application code that uses the PML API.

Library is a subset of Distribution, which is located at:

Distribution:pml_distribution/lib/pml.jar

Source

The PML Source contains just the source code directory org/.

Source is a subset of Distribution, which is located at:

 Distribution:pml_distribution/lib/pml.jar

The source code is also available on Google Code. Instructions for checking out the source via svn are available here.

Distribution

If you want all you can get, get the Distribution jar. The Distribution includes:

Java code examples from PML Primer

The PML Primer http://inference-web.org/2007/primer/ (and the internal draft iw:PML Primer) reference java files that produce the portions of PML that the Primer is showing. The java file references are relative to the PML API distribution.

Dependencies

Add these to your CLASSPATH:

  • Jena
    • trunk/lib/Jena-2.5.6/lib/*.jar
  • JUnit
    • trunk/lib/junit-4.1.jar

Key Classes and their Methods

PMLObjectManager

  • createPMLObject - creates all instances when given a class' local name.
    • PMLP - contains constants for the URIs of the vocabulary (e.g. Agent_lname = "Agent")
    • IWInformation description = (IWInformation)PMLObjectManager.createPMLObject(PMLP.Information_lname); [1]
    • getObjectID - returns some internal notion of an Identifier given a URI as a String. Give the ID to the PML instance setIdentifier to give it a URI.
  • printPMLObjectToString - serializes the PML object model.

Open Source License

Our intent is to offer PML API with an open source license. We just need to get the verbiage and include it in the code.

FAQ

  • Are the javadocs online? yes.
  • How do the links to the jars on this page get refreshed from the Google SVN (am I getting the latest and greatest)?
  • What advantages does the PML API have over using vanilla RDF APIs (e.g., Sesame or Jena) directly? (i.e., Is it more than a vocab-specific Jena?)
    • Cached document loading. When calling PMLObjectManager.getPMLObjectFromFile, it loads the file into Jena model and subsequent instance retrievals use the same in-memory model.
    • A: Handles lists better
  • Does PML API do any validation when it loads PML instance data?
  • What disadvantages does the PML API have over using vanilla RDF APIs?
    • A: PML API has more dependencies.
  • I'm already using {Sesame, Jena} to read and write the RDF in my application. How well does PML API integrate with what I'm already doing?
  • Does PML API handle any RDF syntax other than RDF/XML?
    • nope.
  • What is the scope of th ePML
    • The PML API provides functionality for Read (with caching), Write PML documents.
  • How do I get non-PML descriptions on a PML instance that I retrieve?
    • e.g., inferenceEngine.getProperty(DCTerms.description.stringValue());

How do I load a PML document?

  • How do I load a PML file? (from disk, from web?)

PMLObjectManager.getPMLObject and friends

  • Huh? I have to know what's in a file before I go get it?
getPMLObjectFromFile

public static java.lang.Object getPMLObjectFromFile(java.lang.String URIStr,
                                                    java.lang.String sourceFileURL)

    Returns a PML object identified by its URI and is loaded from a specific file.

    Parameters:
        URIStr - URI of PML object
        sourceFileURL - URL of the file from which the object is to be created 
  • Why not a visitor pattern? Hand it a file. visitNodeSet, visitInformation, etc.

PML API Issues

{{#vardefine:type|PML API Issue}}total 1729warning.pngSome part "<nowiki></nowiki>" of the query was not understood. Some use of "<nowiki>[[</nowiki>" in your query was not closed by a matching "]]". Some subquery has no valid condition.

Dcterms:description Foaf:homepage
0.2
0.21
02809-ca.png
02809-overview.png
02809-ri.png
10 February 2004, revised $Date: 2004/09/24 18:12:02 $
17:53, 20 January 2009 (UTC)
1999-07-02
2000-07-11
2001-05-21
2002-07-13
2003-02-15
2004-06-14
2004-09-20
2005-06-13
2007
2007-10-24
2008-01-14
2008-10-16
20081016 Optimal Proof.png
20081016 Original Proof.png
2009-02-19
2009-02-26
2009-03-05
2009-03-12
2009-03-19
2009-04-02
2009-04-16
2011 30 June UTEP visit to RPI
2011 30 June UTEP visit to RPI minutes
File:2011-06.30-lebo-csv2rdf4lod-pml.pdf
File:2011-06.30-lebo-csv2rdf4lod-pml.pptx
2012-04-18-provenance-abstraction-proposal
21 April 2009 15:26:33
21 April 2009 15:26:34
21 April 2009 15:26:35
21 April 2009 15:26:36
21 April 2009 15:27:28
21 April 2009 15:27:29
27 January 2009 21:20:44
27 January 2009 21:20:45
27 January 2009 21:20:46
27 January 2009 21:20:47
27 January 2009 21:20:52
27 January 2009 21:20:53
358116431.jpg
93117-overview.png
93117-pollutionPopup.png
98052-page3.png
98052-pollutionPopup.png
… further results

warning.pngSome part "<nowiki></nowiki>" of the query was not understood. The symbol "[[" was used in a place where it is not useful. Some subquery has no valid condition.

Facts about PML API (Project)RDF feed
ATool  +
Dc:creatorCynthia  +
Dc:descriptiona JAVA API for managing PML data
Dcterms:modified2011-5-19
Foaf:namePML API (Project)
Skos:altLabelPML API (Project)  +
Personal tools
Navigation