Package org.jrdf.graph

Examples of org.jrdf.graph.ObjectNode


                                       String predicate,
                                       String object,
                                       boolean isLiteral,
                                       String datatype)
            throws ServerException {
        ObjectNode o = null;
        try {
            if (object != null) {
                if (isLiteral) {
                    if (datatype == null || datatype.length() == 0) {
                        o = new SimpleLiteral(object);
View Full Code Here


    public static ObjectNode makeObjectFromURIandLiteral(String objURI,
                                                         boolean isLiteral,
                                                         URI literalType,
                                                         String language)
            throws URISyntaxException {
        ObjectNode obj = null;
        if (isLiteral) {
            if (literalType != null) {
                obj = new SimpleLiteral(objURI, literalType);
            } else if (language != null){
                obj = new SimpleLiteral(objURI, language);
View Full Code Here

    }

    public static RelationshipTuple fromTriple(Triple triple) {
        String subject = triple.getSubject().toString();
        String predicate = triple.getPredicate().toString();
        ObjectNode objectNode = triple.getObject();
        if (objectNode instanceof Literal) {
            return getLiteral(subject, predicate, (Literal)objectNode);
        } else {
            return new RelationshipTuple(subject, predicate, objectNode.toString(), false, null, null);
        }
       
    }
View Full Code Here

        if (object == null) {
            logger.warn("Object cannot be null");
            return rels;
        }
        PredicateNode p;
        ObjectNode o;
        try {
                o = TripleMaker.createResource(getFedoraResourceURI(object));
            if (relationship != null) {
                p = TripleMaker.createResource(relationship);
            } else {
View Full Code Here

    private void addRelationshipTriples(DOReader reader,
                                        URIReference objURI,
                                        Set<Triple> set)
            throws Exception {
        for (RelationshipTuple tuple : reader.getRelationships()) {
            ObjectNode oNode;
            if (tuple.isLiteral) {
                if (tuple.datatype != null) {
                    oNode = new SimpleLiteral(tuple.object,
                                              tuple.datatype);
                } else if (tuple.language != null){
View Full Code Here

                       RDFName predicate,
                       Date dateValue,
                       Set<Triple> set) throws Exception {
        if (dateValue != null) {
            String lexicalValue = DateUtility.convertDateToXSDString(dateValue);
            ObjectNode object = new SimpleLiteral(lexicalValue,
                                                  RDF_XSD.DATE_TIME.getURI());
            set.add(new SimpleTriple(subject, predicate, object));
        }
    }
View Full Code Here

                for (int i = 0; iter.hasNext(); i++) {
                    Triple triple = iter.next();
                    String object = null;
                    boolean isLiteral = false;
                    URI typeURI = null;
                    ObjectNode oNode = triple.getObject();
                    if (oNode instanceof Literal) {
                        isLiteral = true;
                        typeURI = ((Literal) oNode).getDatatypeURI();
                    }
                    object = oNode.toString();
                    entries.add(new RelationshipTuple(triple.getSubject()
                                                              .toString(),
                                                      triple.getPredicate()
                                                              .toString(),
                                                      object,
View Full Code Here

                              Constants.MODEL.CREATED_DATE.uri);
        TripleIterator results = spo(query);

        try {
            assertTrue(results.hasNext());
            ObjectNode dateNode = results.next().getObject();
            assertTrue(dateNode instanceof Literal);
            Literal dateLiteral = (Literal) dateNode;
            assertEquals(dateLiteral.getDatatypeURI().toString(),
                         Constants.RDF_XSD.DATE_TIME.uri);
            assertEquals(xsdDateTime, dateLiteral.getLexicalForm());
View Full Code Here

                                       String predicate,
                                       String object,
                                       boolean isLiteral,
                                       String datatype)
            throws ServerException {
        ObjectNode o = null;
        try {
            if (isLiteral) {
                if (datatype == null || datatype.length() == 0) {
                    o = new SimpleLiteral(object);
                } else {
View Full Code Here

TOP

Related Classes of org.jrdf.graph.ObjectNode

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.