/**
 * Copyright (c) 2016, German Neuroinformatics Node (G-Node)
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted under the terms of the BSD License. See
 * LICENSE file in the root of the Project.
 */

package org.g_node.micro.commons;

import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.DCTerms;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD;

/**
 * Class contains small helper functions when dealing with Jena RDF models.
 *
 * @author Michael Sonntag (sonntag@bio.lmu.de)
 */
public final class RDFUtils {
    /**
     * Namespace used to identify RDF resources.
     */
    public static final String RDF_NS_RDF = RDF.getURI();
    /**
     * RDF namespace prefix.
     */
    public static final String RDF_NS_RDF_ABR = "rdf";
    /**
     * Namespace used to identify RDFS resources.
     */
    public static final String RDF_NS_RDFS = RDFS.getURI();
    /**
     * RDFS namespace prefix.
     */
    public static final String RDF_NS_RDFS_ABR = "rdfs";
    /**
     * Namespace used to identify XSD resources.
     */
    public static final String RDF_NS_XSD = XSD.getURI();
    /**
     * XSD namespace prefix.
     */
    public static final String RDF_NS_XSD_ABR = "xs";
    /**
     * Namespace used to identify FOAF RDF resources.
     */
    public static final String RDF_NS_FOAF = "http://xmlns.com/foaf/0.1/";
    /**
     * FOAF Namespace prefix.
     */
    public static final String RDF_NS_FOAF_ABR = "foaf";
    /**
     * Namespace used to identify Dublin core resources.
     */
    public static final String RDF_NS_DC = DCTerms.NS;
    /**
     * Dublin core Namespace prefix.
     */
    public static final String RDF_NS_DC_ABR = "dc";
    /**
     * Core Ontology for neuroscientific metadata defined by the G-Node.
      */
    public static final String RDF_NS_GN_ONT = "https://github.com/G-Node/neuro-ontology/";
    /**
     * G-Node ontology namespace prefix.
     */
    public static final String RDF_NS_GN_ONT_ABR = "gn";
    /**
     * Method adds an RDF Literal only to a Jena Resource, if the Literal String
     * actually contains a value.
     * @param res Jena Resource.
     * @param p Jena Property.
     * @param litStr String containing the value of the Literal.
     */
    public static void addNonEmptyLiteral(final Resource res, final Property p, final String litStr) {
        if (litStr != null && !litStr.isEmpty()) {
            res.addLiteral(p, litStr);
        }
    }
}

@@ -21,9 +21,9 @@
  201
-6
+5
 , Ge
@@ -402,169 +402,8 @@
 rce;
-%0Aimport com.hp.hpl.jena.vocabulary.DCTerms;%0Aimport com.hp.hpl.jena.vocabulary.RDF;%0Aimport com.hp.hpl.jena.vocabulary.RDFS;%0Aimport com.hp.hpl.jena.vocabulary.XSD;
 %0A%0A/*
@@ -577,1460 +577,8 @@
 /**%0A
-     * Namespace used to identify RDF resources.%0A     */%0A    public static final String RDF_NS_RDF = RDF.getURI();%0A    /**%0A     * RDF namespace prefix.%0A     */%0A    public static final String RDF_NS_RDF_ABR = %22rdf%22;%0A    /**%0A     * Namespace used to identify RDFS resources.%0A     */%0A    public static final String RDF_NS_RDFS = RDFS.getURI();%0A    /**%0A     * RDFS namespace prefix.%0A     */%0A    public static final String RDF_NS_RDFS_ABR = %22rdfs%22;%0A    /**%0A     * Namespace used to identify XSD resources.%0A     */%0A    public static final String RDF_NS_XSD = XSD.getURI();%0A    /**%0A     * XSD namespace prefix.%0A     */%0A    public static final String RDF_NS_XSD_ABR = %22xs%22;%0A    /**%0A     * Namespace used to identify FOAF RDF resources.%0A     */%0A    public static final String RDF_NS_FOAF = %22http://xmlns.com/foaf/0.1/%22;%0A    /**%0A     * FOAF Namespace prefix.%0A     */%0A    public static final String RDF_NS_FOAF_ABR = %22foaf%22;%0A    /**%0A     * Namespace used to identify Dublin core resources.%0A     */%0A    public static final String RDF_NS_DC = DCTerms.NS;%0A    /**%0A     * Dublin core Namespace prefix.%0A     */%0A    public static final String RDF_NS_DC_ABR = %22dc%22;%0A    /**%0A     * Core Ontology for neuroscientific metadata defined by the G-Node.%0A      */%0A    public static final String RDF_NS_GN_ONT = %22https://github.com/G-Node/neuro-ontology/%22;%0A    /**%0A     * G-Node ontology namespace prefix.%0A     */%0A    public static final String RDF_NS_GN_ONT_ABR = %22gn%22;%0A    /**%0A
     
@@ -1028,16 +1028,17 @@
       %7D%0A
-
     %7D%0A
+%0A
 %7D%0A

Remove RDF namespace constants