Package org.iirds.rdf

Class RDFUtils

java.lang.Object
org.iirds.rdf.RDFUtils

public class RDFUtils extends Object
RDF utilities
Author:
Martin Kreutzer, Empolis Information Management GmbH
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.rdf.model.Property
    getProperty(org.apache.jena.rdf.model.Model model, String propertyURI)
    Get the property for a property URI
    static Map<org.apache.jena.rdf.model.Resource,Set<String>>
    getTypeMap(org.apache.jena.rdf.model.Model model)
    Get a map of resources to a the type URIs (excluding Literals)
    static Set<String>
    getTypes(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.RDFNode resource)
    Get RDF type URIs of a resoruce
    static boolean
    hasAttribute(org.apache.jena.rdf.model.Resource resource, String propertyURI)
     
    static boolean
    isLabelStatement(org.apache.jena.rdf.model.Statement stmt)
     
    static boolean
    isTypeStatement(org.apache.jena.rdf.model.Statement stmt)
     
    static String
    toString(org.apache.jena.rdf.model.Model model)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isLabelStatement

      public static boolean isLabelStatement(org.apache.jena.rdf.model.Statement stmt)
    • isTypeStatement

      public static boolean isTypeStatement(org.apache.jena.rdf.model.Statement stmt)
    • getTypes

      public static Set<String> getTypes(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.RDFNode resource)
      Get RDF type URIs of a resoruce
      Parameters:
      model - the RDF model
      resource - the resource
      Returns:
      set of type URIs, excluding those starting with http://www.w3.org/2000/01/rdf and http://www.w3.org/1999/02/22-rdf
    • getTypeMap

      public static Map<org.apache.jena.rdf.model.Resource,Set<String>> getTypeMap(org.apache.jena.rdf.model.Model model)
      Get a map of resources to a the type URIs (excluding Literals)
      Parameters:
      model - the model to analyze
      Returns:
      the map of Resource to set fo type URIs
    • toString

      public static String toString(org.apache.jena.rdf.model.Model model)
    • getProperty

      public static org.apache.jena.rdf.model.Property getProperty(org.apache.jena.rdf.model.Model model, String propertyURI)
      Get the property for a property URI
      Parameters:
      model - the RDF model
      propertyURI - the IRI of the property
      Returns:
      the property
    • hasAttribute

      public static boolean hasAttribute(org.apache.jena.rdf.model.Resource resource, String propertyURI)