Ontop can not Import mappings - h2

I am trying to make this tutorial
http://optique-project.eu/training-programme/module-ontop/
In this step
Import mappings: Ontop>>Import R2RML mappingsā€¦ <northwind-mapping-M2T2.ttl >
I am waiting more than a hour and no result. This is what it is. And I have no idea whta can I do.
The problem comes with the import of mappings.

Related

Edit State File of ElasticSearch 7.3

I have one ElasticNode 7.3.2 in my cluster which has crashed and since then isn't able to restart, but still contains important data (last replicas are on this node).
Caused by: java.io.IOException: failed to find metadata for existing index indexname-2019.06.23 [location: ORVU14kLSf6kIv8ULliijA, generation: 178]
i dont care about this special index, can i just remove this one from the state file? I already tried to remove it via an HexEditor, but then he complains about are not valid hash-checksum ;)
I already tried to decode it via SMILE, but it seems that *.st files dont follow the exact specifications only partially.
Does someone has an idea? Or a good tool to edit it?
Thanks
I had a similar case in which I corrupted my index settings with invalid similarity settings. Unfortunately, the settings were written to file by ES without validity check and afterwards I could not open the index again. So I got the index meta data from data/nodes/0/indices/<index UID>/_state/state-xx.st and figured out how to load it, change it and store it back again. I used ES 5.4 so the code I give here will be slightly different in ES 7.x. It goes like this:
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Paths;
public class RepairIndexSettings {
public static void main(String args[]) throws IOException {
// Load the existing, possibly corrupt index file
IndexMetaData d = IndexMetaData.FORMAT.read(NamedXContentRegistry.EMPTY, Paths.get( "indexstaterepair","_state", "state-11.st"));
// Create new IndexMetaData by copying all the valid meta data from the original and removing or fixing
// the corrupt settings.
Settings.Builder sb = Settings.builder();
for (String key : d.getSettings().keySet()) {
if (!key.contains("similarity"))
sb.put(key, d.getSettings().get(key));
}
IndexMetaData newd = IndexMetaData.builder(d).settings(sb).build();
// Write the new index state to file
IndexMetaData.FORMAT.write(newd, Paths.get("indexstaterepair"));
}
}
I replaced the original state file with the new one and could open and use the index normally afterwards.
You would have to use another MetaData subclass but I think it should be quite similar otherwise.
No, there's no way to edit any files inside the data directory by hand. If you're getting an exception like failed to find metadata for existing index then there's something quite wrong with your storage, or something other than Elasticsearch has modified its contents. In either case, this has corrupted this node. The best path forward is to wipe the data path and start the node afresh so that Elasticsearch can rebuild any lost shards from elsewhere in the cluster or else restore them from a recent snapshot.

Use Dash with websockets

What is the best way to use Dash with Websockets to build a real-time dashboard ? I would like to update a graph everytime a message is received but the only thing I've found is calling the callback every x seconds like the example below.
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_daq as daq
from dash.dependencies import Input, Output
import plotly
import plotly.graph_objs as go
from websocket import create_connection
from tinydb import TinyDB, Query
import json
import ssl
# Setting up the websocket and the necessary web handles
ws = create_connection(address, sslopt={"cert_reqs": ssl.CERT_NONE})
app = dash.Dash(__name__)
app.layout = html.Div(
[
dcc.Graph(id='live-graph', animate=True),
dcc.Interval(
id='graph-update',
interval=1*1000,
n_intervals=0)
]
)
#app.callback(Output('live-graph', 'figure'),
[Input('graph-update', 'n_intervals')])
def update_graph_live(n):
message = ws.recv()
x=message.get('data1')
y=message.get('data2')
.....
fig = go.Figure(
data = [go.Bar(x=x,y=y)],
layout=go.Layout(
title=go.layout.Title(text="Bar Chart")
)
)
)
return fig
if __name__ == '__main__':
app.run_server(debug=True)
Is there a way to trigger the callback everytime a message is received (maybe storing them in a database before) ?
This forum post describes a method to use websocket callbacks with Dash:
https://community.plot.ly/t/triggering-callback-from-within-python/23321/6
Update
Tried it, it works well. Environment is Windows 10 x64 + Python 3.7.
To test, download the .tar.gz file and run python usage.py. It will complain about some missing packages, install these. Might have to edit the address from 0.0.0.0 to 127.0.0.1 in usage.py. Browse to http://127.0.0.1:5000 to see the results. If I had more time, I'd put this example up on GitHub (ping me if you're having trouble getting it to work, or the original gets lost).
I had two separate servers: one for dash, the other one as a socket server. They are running on different ports. On receiving a message, I edited a common json file to share information to dash's callback. That's how I did it.

Angular 2 - Rxjs Intelligent with VS 2015 update 3

I am learning the Angular 2.
I am following exactly the tutorial Tour of Heroes (https://angular.io/docs/ts/latest/tutorial/), I have everything work just fine.
Just one thing, it looks like the VS 2015 (with update 3) doesn't recognize extension functions from the Rxjs, can you advise how to fix it?
I have all imported as in the tutorial
// Observable class extensions
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/throw';
// Observable operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
a note while checking the file rxjs/add/operator/debounce.d.ts
the observable founder is not found, in fact the folder is there
Try this:
import {Subject, Observable} from 'rxjs/Rx';

Hbase Import Table Error

I was trying to import the data from one hbase(v0.98.4) to another hbase(v0.98.13).
I have exported the data using the below command -
hbase org.apache.hadoop.hbase.mapreduce.Driver export 'tblname' /path/
But I am not able to import it using the below command -
hbase org.apache.hadoop.hbase.mapreduce.Driver import 'tblname' /hdfs/path/
I get the below deprecation messages as well as an Exception thrown -
Is it becoz of version conflicts between source db and destination db?
I happen to solve it. All I had to do was create an empty table with same metadata and then import it. :)
Try using the commands here for Hbase versions above 0.94. May be you are using generalized Map reduce class and giving export and import as arguments, when the actual classes Export and Import are present. Hope it helps. Happy coding

Import _Installation.json of Parse.com Export

how can I import the exported _Installation-data? When I try to set the classname to _Installation, I just get the error "cannot import into this special class"
Workaround so far: Iterating over the exported _Installation.json and recreating the objects via POST against https://api.parse.com/1/classes/_Installation .
This is no real backup restore as this creates new objectIds, createdAts and updatedAts but better than nothing.
Meanwhile, this feature has been added.

Resources