Readme.md 2.3 KB
Newer Older
Tobias Steiner's avatar
Tobias Steiner committed
1
2
3
4
# Histhub-net widget
The histhub-net widget can display sameas resources from histhub linking services. You can integrate it into your site and display links to other providers.
 
 __The widget and the api's are in beta status. They may change in the future.__
Tobias Steiner's avatar
Tobias Steiner committed
5
## Webcomponent
Tobias Steiner's avatar
Tobias Steiner committed
6
The widget itself is a [webcomponent](https://en.wikipedia.org/wiki/Web_Components). It integrates smoothly into an existing website. You just need to add some markup and load a javascript file.
Tobias Steiner's avatar
Tobias Steiner committed
7
## Integration
Tobias Steiner's avatar
Tobias Steiner committed
8
Just have a look at the example folder. There you can find a set of working examples.
Tobias Steiner's avatar
Tobias Steiner committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
```html
<html>
<head>
    <!-- load the script in your header -->
    <script src="../src/histhub-widget.js"></script>
</head>
</html>
```
```html
<!-- add the component wehre you like to display the links -->
<histhub-widget endpoint="ENDPOINT" resolver="RESOLVER" location="URL TO LOOK FOR"></histhub-widget>
```
## API
### Endpoint
The endpoint defines the restapi, where the widget makes the call to get the links. Currently we provide three endpoints for different resource types.
* Tagcloud https://api.tagcloud.histhub.ch/v1/sameas/
* Geolinker https://api.geolinker.histhub.ch/v1/sameas/
* Geolinker https://api.geolinker.histhub.ch/v1/similarto/
27
28
* Geolinker https://api.geolinker.histhub.ch/v1-1/sameas/ (newer apis)
* Geolinker https://api.geolinker.histhub.ch/v1-1/similarto/ (newer apis)
Tobias Steiner's avatar
Tobias Steiner committed
29
30
31
32
33
34
35
36
* Orgalinker https://api.orgalinker.histhub.ch/v1/sameas/

Choose one of the endpoint to get links for your resource
### Resolver
The endpoint uses different technologies to generate the links. Those technologies calls resolver. You need to define a resolver to get the links for your preferences.

__Tagcloud and Orgalinker__

Tobias Steiner's avatar
Tobias Steiner committed
37
For those two services we provide the `resolvermanual` . The links provided by this resolver are done by humans. See example 1 and example 2
Tobias Steiner's avatar
Tobias Steiner committed
38
39
40

__Geolinker__

Tobias Steiner's avatar
Tobias Steiner committed
41
The geolinker provides for the `sameas` endpoint the  `resolverneo4j` resolver. The links provided by this resolver are done semi-automatically. See example 3
Tobias Steiner's avatar
Tobias Steiner committed
42
43
44
45
46
47
48

For the `similarto` endpoint the geolinker provides a `elasticsearchresolver`. The data are guessed based on a matching algorithm. See example 4

### Location
The location is an optional parameter. By default the widget uses the current window.location.href to make the request. You can specify the url to look for over the url parameter