Package org.openrdf.model

Examples of org.openrdf.model.BNode


    }

    private void addItem(Resource listing) throws ExtractionException {
        Node node = fragment.findMicroformattedObjectNode("*", "item");
        if (null == node) return;
        BNode blankItem = valueFactory.createBNode();
        addBNodeProperty(
                node,
                listing, hLISTING.item, blankItem
        );
        addURIProperty(blankItem, RDF.TYPE, hLISTING.Item);
View Full Code Here


        // Empty.
    }

    @Override
    protected boolean extractEntity(Node node, ExtractionResult out) throws ExtractionException {
        final BNode recipe = getBlankNodeFor(node);
        conditionallyAddResourceProperty(recipe, RDF.TYPE, vHRECIPE.Recipe);
        final HTMLDocument fragment = new HTMLDocument(node);
        addFN(fragment, recipe);
        addIngredients(fragment, recipe);
        addYield(fragment, recipe);
View Full Code Here

     * @param fragment
     * @param ingredient
     * @return
     */
    private BNode addIngredient(HTMLDocument fragment,  HTMLDocument.TextField ingredient) {
        final BNode ingredientBnode = getBlankNodeFor(ingredient.source());
        addURIProperty(ingredientBnode, RDF.TYPE, vHRECIPE.Ingredient);
        conditionallyAddStringProperty(
                ingredient.source(),
                ingredientBnode,
                vHRECIPE.ingredientName,
View Full Code Here

     * @param duration
     * @return
     */
    //TODO: USE http://microformats.org/wiki/value-class-pattern to read correct date format.
    private BNode addDuration(HTMLDocument fragment, HTMLDocument.TextField duration) {
        final BNode durationBnode = getBlankNodeFor(duration.source());
        addURIProperty(durationBnode, RDF.TYPE, vHRECIPE.Duration);
        conditionallyAddStringProperty(
                duration.source(),
                durationBnode, vHRECIPE.durationTime, duration.value()
        );
View Full Code Here

     * @param fragment
     * @param nutrition
     * @return
     */
    private BNode addNutrition(HTMLDocument fragment, HTMLDocument.TextField nutrition) {
        final BNode nutritionBnode = getBlankNodeFor(nutrition.source());
        addURIProperty(nutritionBnode, RDF.TYPE, vHRECIPE.Nutrition);
        conditionallyAddStringProperty(
                nutrition.source(),
                nutritionBnode, vHRECIPE.nutritionValue, nutrition.value()
        );
View Full Code Here

     * @throws org.apache.any23.extractor.ExtractionException
     *
     */
    @Override
    protected boolean extractEntity(Node node, ExtractionResult out) throws ExtractionException {
        BNode biota = getBlankNodeFor(node);
        conditionallyAddResourceProperty(biota, RDF.TYPE, vWO.species);

        final HTMLDocument fragment = new HTMLDocument(node);
        addNames(fragment, biota);
        addClasses(fragment, biota);
View Full Code Here

    private void addClasses(HTMLDocument doc, Resource biota) throws ExtractionException {
        for(String clazz : classes) {
            HTMLDocument.TextField classTextField = doc.getSingularUrlField(clazz);
            if(classTextField.source() != null) {
                BNode classBNode = getBlankNodeFor(classTextField.source());
                addBNodeProperty(biota, vWO.getProperty(clazz), classBNode);
                conditionallyAddResourceProperty(classBNode, RDF.TYPE, resolveClassName(clazz));
                HTMLDocument fragment = new HTMLDocument(classTextField.source());
                addClassesName(fragment, classBNode);
            }
View Full Code Here

        factoryWrapper.setIssueReport(out);
        try {
            document = new HTMLDocument(in);
            this.out = out;

            BNode subject = factoryWrapper.createBNode();
            boolean foundAnyXFN = false;
            final URI documentURI = extractionContext.getDocumentURI();
            for (Node link : document.findAll("//A[@rel][@href]")) {
                foundAnyXFN |= extractLink(link, subject, documentURI);
            }
View Full Code Here

                return false;    // "me" cannot be combined with any other XFN values
            }
            out.writeTriple(subject, vXFN.mePage, link);
            out.writeTriple(documentURI, vXFN.getExtendedProperty("me"), link);
        } else {
            BNode person2 = factoryWrapper.createBNode();
            boolean foundAnyXFNRel = false;
            for (String aRel : rels) {
                foundAnyXFNRel |= extractRel(aRel, subject, documentURI, person2, link);
            }
            if (!foundAnyXFNRel) {
View Full Code Here

    protected boolean extractEntity(Node node, ExtractionResult out) {
        if (null == node) return false;
        //try lat & lon
        final HTMLDocument document = new HTMLDocument(node);
        BNode adr = getBlankNodeFor(node);
        out.writeTriple(adr, RDF.TYPE, vVCARD.Address);
        final String extractorName = getDescription().getExtractorName();
        for (String field : addressFields) {
            HTMLDocument.TextField[] values = document.getPluralTextField(field);
            for (HTMLDocument.TextField val : values) {
View Full Code Here

TOP

Related Classes of org.openrdf.model.BNode

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.