Package com.hp.hpl.jena.rdf.model.impl

Examples of com.hp.hpl.jena.rdf.model.impl.ModelCom


    public FileGraph( NotifyOnClose notify, File f, String lang, boolean create, boolean strict, ReificationStyle style )
        {
        super( style );
        this.name = f;
        this.notify = notify;
        this.model = new ModelCom( this );
        this.lang = lang;
        if (create)
            { if (f.exists() && strict) throw new AlreadyExistsException( f.toString() ); }
        else
            readModel( this.model, strict );
View Full Code Here


    /**
        Answer a fresh Model with the default specification.
    */
    public static Model createDefaultModel()
        { return new ModelCom( Factory.createGraphMem( ) ); }
View Full Code Here

        Answer a new memory-based model with the given reification style
        @deprecated     Hidden partial reifications not supported -- only style "Standard"
    */
    @Deprecated
    public static Model createDefaultModel( ReificationStyle style )
        { return new ModelCom( Factory.createGraphMem( ) ); }
View Full Code Here

        undisturbed.
        @param g A graph structure
        @return A model presenting an API view of graph g
    */
    public static Model createModelForGraph( Graph g ) {
        return new ModelCom( g );
    }
View Full Code Here

    */
    public FileGraph( NotifyOnClose notify, File f, String lang, boolean create, boolean strict )
        {
        this.name = f;
        this.notify = notify;
        this.model = new ModelCom( this );
        this.lang = lang;
        if (create)
            { if (f.exists() && strict) throw new AlreadyExistsException( f.toString() ); }
        else
            readModel( this.model, strict );
View Full Code Here

        }

    @Override
    protected Model openEmptyModel( Assembler a, Resource root, Mode irrelevant )
        {
        return new ModelCom( Factory.createDefaultGraph() )
            {
            @Override
            public Model begin()
                {
                history.add( "begin" );
View Full Code Here

  public void testModelComContainsSPcallsContainsSPO()
  {
    final Graph g = Factory.createDefaultGraph();
    final boolean[] wasCalled = { false };
    // FIXME change to dynamic proxy
    final Model m = new ModelCom(g) {
      @Override
      public boolean contains( final Resource s, final Property p,
          final RDFNode o )
      {
        wasCalled[0] = true;
        return super.contains(s, p, o);
      }
    };
    Assert.assertFalse(m.contains(ModelHelper.resource("r"),
        ModelHelper.property("p")));
    Assert.assertTrue("contains(S,P) should call contains(S,P,O)",
        wasCalled[0]);
  }
View Full Code Here

    /**
        Answer a fresh Model with the default specification.
    */
    public static Model createDefaultModel()
        { return new ModelCom( Factory.createGraphMem( ) ); }
View Full Code Here

        undisturbed.
        @param g A graph structure
        @return A model presenting an API view of graph g
    */
    public static Model createModelForGraph( Graph g ) {
        return new ModelCom( g );
    }
View Full Code Here

   mean emptyness isn't available. This is why we go round the houses and
   test that expected ~= initialContent + addedStuff - removed - initialContent.
   */
  public void testRemoveSPO()
      {
      ModelCom mc = (ModelCom) ModelFactory.createDefaultModel();
            for ( String[] aCase : cases )
            {
                for ( int j = 0; j < 3; j += 1 )
                {
                    Model content = getModel();
                    Model baseContent = copy( content );
                    modelAdd( content, aCase[0] );
                    Triple remove = triple( aCase[1] );
                    Node s = remove.getSubject(), p = remove.getPredicate(), o = remove.getObject();
                    Resource S = (Resource) ( s.equals( Node.ANY ) ? null : mc.getRDFNode( s ) );
                    Property P = ( ( p.equals( Node.ANY ) ? null : mc.getRDFNode( p ).as( Property.class ) ) );
                    RDFNode O = o.equals( Node.ANY ) ? null : mc.getRDFNode( o );
                    Model expected = modelWithStatements( aCase[2] );
                    content.removeAll( S, P, O );
                    Model finalContent = copy( content ).remove( baseContent );
                    assertIsoModels( aCase[1], expected, finalContent );
                }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.impl.ModelCom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.