小编Fre*_*ead的帖子

Flask 获取视口大小

一个简短的问题:有没有办法通过 Flask 获取浏览器视口大小?

我正在为许多设备设计一个页面,例如:普通PC、iPhone等......

谢谢你,FFodWindow

html python flask

5
推荐指数
1
解决办法
6379
查看次数

如何使用回调更改字形的颜色?

我尝试过使用 Bokeh,现在我想搜索一个单词并更改其字形的颜色。我的代码看起来像这样:

import bokeh.plotting as bp
from bokeh.models import HoverTool, CustomJS
from bokeh.models.widgets import TextInput
from bokeh.io import vform

words = ["werner", "herbert", "klaus"]
x=[1,2,3]
y=[1,2,3]
color = ['green', 'blue', 'red']
word_input= TextInput(value="word", title="Point out a word")

source = bp.ColumnDataSource(data= dict(x=x,y=y,words=words, color='color'))
hover= HoverTool(tooltips=[("word", "@words")])

# output to static HTML file (with CDN resources)
bp.output_file("plot.html", mode="cdn")

# create a new plot with the tools above, and explicit ranges
p = bp.figure(plot_height = 600, plot_width = 800, title="word2vec", tools=[hover], logo =None) …
Run Code Online (Sandbox Code Playgroud)

javascript python callback bokeh

4
推荐指数
1
解决办法
2664
查看次数

RDF - 一个Subject-Property的多个Object

我有一个(也许)简单的问题:我可以将多个ObjectResource分配给固定的主题 - 属性声明吗?

我希望我的RDF-Triples看起来像这样:

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/New_York_Times]

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/The_Guardian]

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/BildZeitung]
Run Code Online (Sandbox Code Playgroud)

等等.这个rdf格式正确吗?

我可以在Apache Jena中实现这个吗?

rdf sparql jena

4
推荐指数
1
解决办法
225
查看次数

Apache Jena TripleStore 的 JavaScript

我已经使用 Apache Jena 构建了一个 TDB-Store,现在我想使用我的商店中的数据来实现一些漂亮的可视化。所以毕竟有必要使用 JavaScript 访问我的 TDB。

我想,有两种可能性可以实现这一点:

第 1 步:运行 Fuseki 服务器并在其端点(即http://localhost:3030/dataset/sparql)上运行 sparql 查询。我如何用js查询这个端点?

第2:直接从js访问TDB。这可能吗?

预先感谢,FFoDWindow

javascript sparql fuseki apache-jena

3
推荐指数
1
解决办法
1448
查看次数

标签 统计

javascript ×2

python ×2

sparql ×2

apache-jena ×1

bokeh ×1

callback ×1

flask ×1

fuseki ×1

html ×1

jena ×1

rdf ×1