/projects/jena-2.6.3/com/hp/hpl/jena/reasoner/rulesys/RDFSRuleInfGraph.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus · Java · 94 lines · 18 code · 9 blank · 67 comment · 0 complexity · 0e1d76696f569c592a388bd7de43e421 MD5 · raw file

  1. /******************************************************************
  2. * File: RDFSRuleInfGraph.java
  3. * Created by: Dave Reynolds
  4. * Created on: 22-Jun-2003
  5. *
  6. * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
  7. * [See end of file]
  8. * $Id: RDFSRuleInfGraph.java,v 1.1 2009/06/29 08:55:38 castagna Exp $
  9. *****************************************************************/
  10. package com.hp.hpl.jena.reasoner.rulesys;
  11. import com.hp.hpl.jena.reasoner.*;
  12. import com.hp.hpl.jena.graph.*;
  13. import java.util.*;
  14. /**
  15. * Customization of the generic rule inference graph for RDFS inference.
  16. * In fact all the rule processing is unchanged, the only extenstion is
  17. * the validation support.
  18. *
  19. * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
  20. * @version $Revision: 1.1 $ on $Date: 2009/06/29 08:55:38 $
  21. */
  22. public class RDFSRuleInfGraph extends FBRuleInfGraph {
  23. /**
  24. * Constructor.
  25. * @param reasoner the reasoner which created this inf graph instance
  26. * @param rules the rules to process
  27. * @param schema the (optional) schema graph to be included
  28. */
  29. public RDFSRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema) {
  30. super(reasoner, rules, schema);
  31. }
  32. /**
  33. * Constructor.
  34. * @param reasoner the reasoner which created this inf graph instance
  35. * @param rules the rules to process
  36. * @param schema the (optional) schema graph to be included
  37. * @param data the data graph to be processed
  38. */
  39. public RDFSRuleInfGraph(Reasoner reasoner, List<Rule> rules, Graph schema, Graph data) {
  40. super(reasoner, rules, schema, data);
  41. }
  42. /**
  43. * Test the consistency of the bound data. For RDFS this checks that all
  44. * instances of datatype-ranged properties have correct data values.
  45. *
  46. * @return a ValidityReport structure
  47. */
  48. @Override
  49. public ValidityReport validate() {
  50. // The full configuration uses validation rules so check for these
  51. StandardValidityReport report = (StandardValidityReport)super.validate();
  52. // Also do a hardwired check to handle the simpler configurations
  53. performDatatypeRangeValidation(report);
  54. return report;
  55. }
  56. }
  57. /*
  58. (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
  59. All rights reserved.
  60. Redistribution and use in source and binary forms, with or without
  61. modification, are permitted provided that the following conditions
  62. are met:
  63. 1. Redistributions of source code must retain the above copyright
  64. notice, this list of conditions and the following disclaimer.
  65. 2. Redistributions in binary form must reproduce the above copyright
  66. notice, this list of conditions and the following disclaimer in the
  67. documentation and/or other materials provided with the distribution.
  68. 3. The name of the author may not be used to endorse or promote products
  69. derived from this software without specific prior written permission.
  70. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  71. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  72. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  73. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  74. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  75. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  76. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  77. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  78. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  79. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  80. */