Scraper

Developers

getRDF

retrieves HTML soure from a given URL

retrieves HTML soure from a given URL and returns triples in JSON-LD wrapper


/getRDF

Usage and SDK Samples

curl -X GET "http://lxbisel.macs.hw.ac.uk:8080/scraper/getRDF?url=&output="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DevelopersApi;

import java.io.File;
import java.util.*;

public class DevelopersApiExample {

    public static void main(String[] args) {
        
        DevelopersApi apiInstance = new DevelopersApi();
        String url = url_example; // String | URL to retrieve source from (must include protocol)
        String output = output_example; // String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.
        try {
            apiInstance.getRDF(url, output);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevelopersApi#getRDF");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DevelopersApi;

public class DevelopersApiExample {

    public static void main(String[] args) {
        DevelopersApi apiInstance = new DevelopersApi();
        String url = url_example; // String | URL to retrieve source from (must include protocol)
        String output = output_example; // String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.
        try {
            apiInstance.getRDF(url, output);
        } catch (ApiException e) {
            System.err.println("Exception when calling DevelopersApi#getRDF");
            e.printStackTrace();
        }
    }
}
String *url = url_example; // URL to retrieve source from (must include protocol)
String *output = output_example; // What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default. (optional)

DevelopersApi *apiInstance = [[DevelopersApi alloc] init];

// retrieves HTML soure from a given URL
[apiInstance getRDFWith:url
    output:output
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Scraper = require('scraper');

var api = new Scraper.DevelopersApi()
var url = url_example; // {{String}} URL to retrieve source from (must include protocol)
var opts = { 
  'output': output_example // {{String}} What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getRDF(url, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getRDFExample
    {
        public void main()
        {

            var apiInstance = new DevelopersApi();
            var url = url_example;  // String | URL to retrieve source from (must include protocol)
            var output = output_example;  // String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default. (optional) 

            try
            {
                // retrieves HTML soure from a given URL
                apiInstance.getRDF(url, output);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DevelopersApi.getRDF: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDevelopersApi();
$url = url_example; // String | URL to retrieve source from (must include protocol)
$output = output_example; // String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.

try {
    $api_instance->getRDF($url, $output);
} catch (Exception $e) {
    echo 'Exception when calling DevelopersApi->getRDF: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DevelopersApi;

my $api_instance = WWW::SwaggerClient::DevelopersApi->new();
my $url = url_example; # String | URL to retrieve source from (must include protocol)
my $output = output_example; # String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.

eval { 
    $api_instance->getRDF(url => $url, output => $output);
};
if ($@) {
    warn "Exception when calling DevelopersApi->getRDF: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DevelopersApi()
url = url_example # String | URL to retrieve source from (must include protocol)
output = output_example # String | What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default. (optional)

try: 
    # retrieves HTML soure from a given URL
    api_instance.get_rdf(url, output=output)
except ApiException as e:
    print("Exception when calling DevelopersApi->getRDF: %s\n" % e)

Parameters

Query parameters
Name Description
url*
String
URL to retrieve source from (must include protocol)
Required
output
String
What format of RDF do you wish returned inside the JSON wrapper. JSON-LD given by default.

Responses

Status: 200 - RDF triples given in JSON wrapper

Status: 400 - missing input parameter

Status: 500 - could not pull source from given URL