Package com.hp.jena.rules.ast

Examples of com.hp.jena.rules.ast.Item$Name


        assertFalse( itemURI.isExpr() );
        }

    @Test public void testItemVariableAccessors()
        {
        Item itemVariable = Item.createVariable( "spoo" );
        assertFalse( itemVariable.isURI() );
        assertTrue( itemVariable.isVariable() );
        assertFalse( itemVariable.isLiteral() );
        assertFalse( itemVariable.isBlank() );
        assertFalse( itemVariable.isFunctor() );
        assertFalse( itemVariable.isExpr() );
        assertEquals( "spoo", itemVariable.getVarName() );
        }
View Full Code Here


        assertEquals( "spoo", itemVariable.getVarName() );
        }
   
    @Test public void testPlainItemLiteralAccessors()
        {
        Item itemLiteral = Item.createPlainLiteral( "spoo" );
        testLiteralPredicates( itemLiteral );
        assertEquals( "spoo", itemLiteral.getLiteralSpelling() );
        assertEquals( null, itemLiteral.getLiteralLanguage() );
        assertEquals( null, itemLiteral.getLiteralType() );
        }
View Full Code Here

        assertEquals( null, itemLiteral.getLiteralType() );
        }
   
    @Test public void testTaggedItemLiteralAccessors()
        {
        Item itemLiteral = Item.createTaggedLiteral( "chat", "en-uk" );
        testLiteralPredicates( itemLiteral );
        assertEquals( "chat", itemLiteral.getLiteralSpelling() );       
        assertEquals( "en-uk", itemLiteral.getLiteralLanguage() );
        assertEquals( null, itemLiteral.getLiteralType() );
        }
View Full Code Here

        assertEquals( null, itemLiteral.getLiteralType() );
        }
   
    @Test public void testTypedtemLiteralAccessors()
        {
        Item itemLiteral = Item.createTypedLiteral( "17", "xsd:integer" );
        testLiteralPredicates( itemLiteral );
        assertEquals( "17", itemLiteral.getLiteralSpelling() );       
        assertEquals( null, itemLiteral.getLiteralLanguage() );
        assertEquals( "xsd:integer", itemLiteral.getLiteralType() );
        }
View Full Code Here

        assertFalse( itemLiteral.isExpr() );
        }
   
    @Test public void testBlankNodeAccessors()
        {
        Item itemBlank = Item.createBNode();
        assertFalse( itemBlank.isURI() );
        assertFalse( itemBlank.isVariable() );
        assertFalse( itemBlank.isExplicitBlank() );
        assertTrue( itemBlank.isBlank() );
        assertFalse( itemBlank.isLiteral() );
        assertFalse( itemBlank.isFunctor() );
        assertFalse( itemBlank.isExpr() );
        }
View Full Code Here

        assertFalse( itemBlank.isExpr() );
        }
   
    @Test public void testExplicitBlankNodeAccessors()
        {
        Item itemBlank = Item.createExplicitBNode( "_blank" );
        assertFalse( itemBlank.isURI() );
        assertFalse( itemBlank.isVariable() );
        assertFalse( itemBlank.isBlank() );
        assertTrue( itemBlank.isExplicitBlank() );
        assertFalse( itemBlank.isLiteral() );
        assertFalse( itemBlank.isFunctor() );
        assertFalse( itemBlank.isExpr() );
        }
View Full Code Here

        }
   
    @Test public void testExprAccessors()
        {
        Expr e = new Expr( "f", new ArrayList<Expr>() );
        Item item = Item.createExpr( e );
        assertSame( e, item.getExpr() );
        assertFalse( item.isURI() );
        assertFalse( item.isVariable() );
        assertFalse( item.isBlank() );
        assertFalse( item.isExplicitBlank() );
        assertFalse( item.isLiteral() );
        assertFalse( item.isFunctor() );
        assertTrue( item.isExpr() );
        }
View Full Code Here

        Item.Visitor<Item.Functor> iv = new Item.VisitorBoom<Item.Functor>()
            {
            @Override public Item.Functor visitFunctor( Item.Functor f )
                { return f; }
            };
        Item functor = Item.createFunctor( "someF", new ArrayList<Expr>() );
        Object actual = functor.visit( iv );
        assertSame( functor, actual );
        }
View Full Code Here

    try {
      InstitutionalIdentity instIdent = (InstitutionalIdentity)getAppConfig()
        .getObject("InstitutionalIdentity");
      UnknownPerson uPerson = (UnknownPerson)getAppConfig()
        .getObject("UnknownPerson");  
      Name aName = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a required object from AppConfig. Log it
      // and throw an exception.
      String errMsg = "An error occurred retrieving a required object from " +
View Full Code Here

        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured Name object out of AppConfig.
    Name name = new Name();
    try {
      name = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a Name object from AppConfig. Log it and
      // throw an exception.
      String errMsg = "An error occurred retrieving a Name object from " +
        "AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdBySsn] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }
   
    // Initialize a query string to retrieve the InstitutionalIdentity.
    String getString1 = "SELECT INST_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, " +
      "SSN, BIRTH_DATE, GENDER FROM T_INST_IDENT WHERE SSN = ? AND " +
      "TERMINATED_DATE IS NULL";
     
    try {
      PreparedStatement getStmt1 = conn.prepareStatement(getString1);
      getStmt1.clearParameters();
      getStmt1.setString(1, ssn);
      ResultSet r1 = getStmt1.executeQuery();
      if (r1.next()) {
        // The InstitutionalIdentity exists. Log a message and build the
        // InstitutionalIdentity object.
        logger.debug("[RdbmsI2sRepository.retrieveInstitutionalIdentityBySsn] "
          + "Found an InstitutionalIdentity in the database for SSN: " + ssn +
          ".");
        // Set the values of the Name object.
        try {
          name.setFirstName(r1.getString(2));
          name.setMiddleName(r1.getString(3));
          name.setLastName(r1.getString(4));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the Name. Log it,
          // close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
View Full Code Here

TOP

Related Classes of com.hp.jena.rules.ast.Item$Name

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.