Class RDFFilesLoader


  • public class RDFFilesLoader
    extends Object
    Help to load RDF files on first time and on every startup.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean areIsomporphic​(org.apache.jena.rdf.model.Model m1, org.apache.jena.rdf.model.Model m2)
      Check 'isomorphism' for purposes of propagating firsttime changes.
      static Set<String> getEnabledLocales​(javax.servlet.ServletContext ctx)  
      static void loadEveryTimeFiles​(javax.servlet.ServletContext ctx, String modelPath, org.apache.jena.ontology.OntModel model)
      Load the "every time" files.
      static void loadFirstTimeFiles​(javax.servlet.ServletContext ctx, String modelPath, org.apache.jena.rdf.model.Model model, boolean firstTime)
      Load the "first time" files if we say it is the first time.
      static void removeBlankTriples​(org.apache.jena.rdf.model.Model model)
      Remove all triples where subject or object is blank (Anon)
      static void removeChangesThatConflictWithUIEdits​(org.apache.jena.rdf.model.Model baseModel, org.apache.jena.rdf.model.Model userModel, org.apache.jena.rdf.model.Model changesModel)
      Check if the user model (UI) changes conflict with the changes made to the firsttime.
    • Method Detail

      • loadFirstTimeFiles

        public static void loadFirstTimeFiles​(javax.servlet.ServletContext ctx,
                                              String modelPath,
                                              org.apache.jena.rdf.model.Model model,
                                              boolean firstTime)
        Load the "first time" files if we say it is the first time. The location is based on the home directory and the model path: "abox", "display", etc. The files from the directory are added to the model.
      • loadEveryTimeFiles

        public static void loadEveryTimeFiles​(javax.servlet.ServletContext ctx,
                                              String modelPath,
                                              org.apache.jena.ontology.OntModel model)
        Load the "every time" files. The location is based on the home directory and the model path: "abox", "display", etc. The files from the directory become a sub-model of the model.
      • getEnabledLocales

        public static Set<String> getEnabledLocales​(javax.servlet.ServletContext ctx)
      • removeChangesThatConflictWithUIEdits

        public static void removeChangesThatConflictWithUIEdits​(org.apache.jena.rdf.model.Model baseModel,
                                                                org.apache.jena.rdf.model.Model userModel,
                                                                org.apache.jena.rdf.model.Model changesModel)
        Check if the user model (UI) changes conflict with the changes made to the firsttime. If there is conflict, the user model UI value will be left unchanged.
        Parameters:
        baseModel - firsttime backup model
        userModel - current state in the system (user/UI-model)
        changesModel - the changes between firsttime-files and firsttime-backup
      • removeBlankTriples

        public static void removeBlankTriples​(org.apache.jena.rdf.model.Model model)
        Remove all triples where subject or object is blank (Anon)
      • areIsomporphic

        public static boolean areIsomporphic​(org.apache.jena.rdf.model.Model m1,
                                             org.apache.jena.rdf.model.Model m2)
        Check 'isomorphism' for purposes of propagating firsttime changes. Run Jena's isomorphism check, but if it fails only due to blank nodes, ignore and treat as isomorphic anyway. (Auto-updating firsttime changes should occur only with named nodes.)
        Parameters:
        m1 -
        m2 -
        Returns:
        true if models are isomorphic or any lack of isomorphism exists only in blank nodes