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

Examples of com.hp.hpl.jena.rdf.model.Resource.removeAll()


      itemPrototype = defaults.getProperty(DefaultValuesHandler.itemPrototype).getResource();
    } catch (NullPointerException ex) {
      itemPrototype = model.createResource();
      defaults.addProperty(DefaultValuesHandler.itemPrototype, itemPrototype);
    }
    itemPrototype.removeAll(RDF.type);
    if (defalutAllowComments) {
        itemPrototype.addProperty(RDF.type, KNOBOT.Commentable);
    } else {
        itemPrototype.addProperty(RDF.type, KNOBOT.NonCommentable);
    }
View Full Code Here


      Statement property = getUniqueProperty(relation, KNOBOT.effectiveDate);
      try  {
        ((XSDDateTime)property.getLiteral().getValue()).asCalendar();
      } catch (ClassCastException e) {
        Date effectiveDate = new Date(property.getLong());
        relation.removeAll(KNOBOT.effectiveDate);
        Literal l = model.createTypedLiteral(new W3CDateFormat()
                    .format(effectiveDate), XSDDatatype.XSDdateTime);
        relation.addProperty(KNOBOT.effectiveDate, l);
        out.println("fixed "+effectiveDate);
      }
View Full Code Here

            Resource relationResource = current.getResource();
            Model relationModel = JenaUtil.getExpandedResource(
                    relationResource, 3);
            relationResource = (Resource) relationResource
                    .inModel(relationModel);
            relationResource.removeAll(KNOBOT.nextRelation);
            resultModel.add(JenaUtil.getExpandedResource(relationResource, 3));
            Resource target = current.getTarget();
            Model targetModel = getItemModelWithoutComments(target, acceptLanguagesStringList, 0, minimalRelevance);/*= JenaUtil
            .getExpandedResource(target, 3);*/
            target = (Resource) target.inModel(targetModel);
View Full Code Here

            resultModel.add(JenaUtil.getExpandedResource(relationResource, 3));
            Resource target = current.getTarget();
            Model targetModel = getItemModelWithoutComments(target, acceptLanguagesStringList, 0, minimalRelevance);/*= JenaUtil
            .getExpandedResource(target, 3);*/
            target = (Resource) target.inModel(targetModel);
            target.removeAll(KNOBOT.firstRelation);
            resultModel.add( JenaUtil
                    .getExpandedResource(target, 3));
            if (recursion < MAX_COMMENT_RECURSION) {
                addComments(current.getTarget(), resultModel, acceptLanguagesStringList, recursion + 1, minimalRelevance);
            }
View Full Code Here

        /*
         * Resource relationInResourceModel = (Resource) relation
         */
        Resource relationInResourceModel = JenaUtil
            .getRoots(relationModel)[0];
        relationInResourceModel.removeAll(KNOBOT.nextRelation);
        // we may still have nextRelation stmts in relationModel
        resultModel.add(JenaUtil.getExpandedResource(
            relationInResourceModel, 3, true));

        boolean isAgent = targetResource.hasProperty(RDF.type,
View Full Code Here

                        // set later date first
                        int interval = aggregator.getProperty(
                                AGGREGATOR.interval).getInt();
                        nextDownload = System.currentTimeMillis() + interval
                                * 60 * 1000;
                        aggregator.removeAll(AGGREGATOR.nextDownload);
                        aggregator.addProperty(AGGREGATOR.nextDownload,
                                model.createTypedLiteral(nextDownload));
                        new Thread() {
                            public void run() {
                                try {
View Full Code Here

            log.info("inserting " + insertion.size() + " statements for: "
                    + aggregated + " from feed at " + feedURL);
            // remove dc:date and rss:image and its target properties
            Resource existingChannel = (Resource) aggregated.inModel(model);
            JenaUtil.deepRemoveProperties(existingChannel);
            existingChannel.removeAll(DC.date);
            StmtIterator images = existingChannel.listProperties(RSS.image);
            while (images.hasNext()) {
                Statement currentImageStmt = images.nextStatement();
                currentImageStmt.getResource().removeProperties();
            }
View Full Code Here

            while (images.hasNext()) {
                Statement currentImageStmt = images.nextStatement();
                currentImageStmt.getResource().removeProperties();
            }
            images.close();
            existingChannel.removeAll(RSS.image);
            model.add(insertion);
            importRelations(aggregated, importing, model);
            if (itemSeq != null) {
                addRSSItems(itemSeq, aggregated, importing, defaultLanguage,
                        model);
View Full Code Here

        DOCUMENT.content, model.createResource(contentURI));
    while (contentURIMatching.hasNext()) {
      Resource current = contentURIMatching.nextResource();
      log.debug("changing "+current);
      if (current.hasProperty(DOCUMENT.contentType, origContentType)) {
        current.removeAll(DC.language);
        if (language != null) {
          current.addProperty(DC.language, language);
        }
        current.removeAll(DOCUMENT.contentType);
        current.addProperty(DOCUMENT.contentType, contentType);
View Full Code Here

      if (current.hasProperty(DOCUMENT.contentType, origContentType)) {
        current.removeAll(DC.language);
        if (language != null) {
          current.addProperty(DC.language, language);
        }
        current.removeAll(DOCUMENT.contentType);
        current.addProperty(DOCUMENT.contentType, contentType);
      }
    }
    contentURIMatching.close();
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.