KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > model > impl > PlainModelSpec


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: PlainModelSpec.java,v 1.12 2005/04/10 12:45:49 chris-dollin Exp $
5 */

6
7 package com.hp.hpl.jena.rdf.model.impl;
8
9 import com.hp.hpl.jena.rdf.model.*;
10 import com.hp.hpl.jena.vocabulary.*;
11
12 /**
13     A ModelSpec that describes plain (non-inference, non-ontological) models.
14     
15     @author kers
16 */

17 public class PlainModelSpec extends ModelSpecImpl implements ModelSpec
18     {
19     /**
20         Initialise this Spec with the ModelMaker that will be used to create all Models that
21         this Spec is used to construct.
22         
23         @param maker the ModelMaker used to make models.
24     */

25     public PlainModelSpec( ModelMaker maker )
26         { super( maker ); }
27         
28     /**
29         Initialise this Spec with a description that will specify the ModelMaker that this
30         Spec is used to construct.
31         
32         @param root the resource of rdf:type JenaModelSpec.maker
33         @param description the RDF who's JenaModelSpec.maker describes the ModelMaker
34     */

35     public PlainModelSpec( Resource root, Model description )
36         { super( root, description );
37         this.root = root; this.description = description; }
38     
39     /**
40         Answer a Model that satisfies the description that this ModelSpec was constructed
41         with.
42     */

43     public Model createModel()
44         { return loadFiles( maker.createModel() ); }
45     
46     /**
47         Answer the Model obtained from the underlying ModelMaker with the given name.
48         We use <code>open</code>, not create, because it's non-strict in any case,
49         and we want to ensure that persistent models will look at their stores.
50         
51         @see com.hp.hpl.jena.rdf.model.ModelSpec#createModelOver(java.lang.String)
52      */

53     public Model createModelOver( String JavaDoc name )
54         { return maker.openModel( name, false ); }
55
56     /**
57         Answer the sub-property of JenaModelSpec.maker that describes how this ModelSpec uses the
58         attached ModelMaker.
59         
60         @return JenaModelSpec.maker
61     */

62     public Property getMakerProperty()
63         { return JenaModelSpec.maker; }
64     }
65
66 /*
67     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
68     All rights reserved.
69
70     Redistribution and use in source and binary forms, with or without
71     modification, are permitted provided that the following conditions
72     are met:
73
74     1. Redistributions of source code must retain the above copyright
75        notice, this list of conditions and the following disclaimer.
76
77     2. Redistributions in binary form must reproduce the above copyright
78        notice, this list of conditions and the following disclaimer in the
79        documentation and/or other materials provided with the distribution.
80
81     3. The name of the author may not be used to endorse or promote products
82        derived from this software without specific prior written permission.
83
84     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
85     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
86     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
87     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
88     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
89     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
90     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
91     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
92     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
93     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94 */
Popular Tags