Geoserver - gsconfig set style for a ambiguous layer name - styles

In my geoserver i have layers with the same name in different workspaces. How can i get_layer from the specific layer of an workspace. example:
Workspace| Store | Layer
Wa | DSa | myLayer
Wb | DSb | myLayer
using get_resource i can distinguish which layer im talking about..
resouce = cat.get_resource(myLayer, store="DSa", workspace="Wa")
but i don't know how can i give to that layer a specific style.
In other hand when i do:
layer = cat.get_layer(myLayer)
i will allways get the first. The problem for me is how can i give a style for each layer.
layer._set_default_style("my_style_name")
In this case how do you set a style for myLayer of Wb and other style for Wa??

The solution it seems to be to use layer = cat.get_layer("Wa:myLayer"). I hope to help someone with the same issue.

Related

Extracting labels from owl ontologies when the label isn't in the ontology but can be found at the URI

Please bear with me as I am new to semantic technologies.
I am trying to use the package rdflib to extract labels from classes in ontologies. However some ontologies don't contain the labels themselves but have the URIs of classes from other ontologies. How does one extract the labels from URIs of the external ontologies?
The intuition behind my attempts center on identifying classes that don't contain labels locally (if that is the right way of putting it) and then "following" their URIs to the external ontologies to extract the labels. However the way I have implemented it does not work.
import rdflib
g = rdflib.Graph()
# I have no trouble extracting labels from this ontology:
# g.load("http://purl.obolibrary.org/obo/po.owl#")
# However, this ontology contains no labels locally:
g.load("http://www.bioassayontology.org/bao/bao_complete.owl#")
owlClass = rdflib.namespace.OWL.Class
rdfType = rdflib.namespace.RDF.type
for s in g.subjects(predicate=rdfType, object=owlClass):
# Where label is present...
if g.label(s) != '':
# Do something with label...
print(g.label(s))
# This is what I have added to try to follow the URI to the external ontology.
elif g.label(s) == '':
g2 = rdflib.Graph()
g2.parse(location=s)
# Do something with label...
print(g.label(s))
Am I taking completely the wrong approach? All help is appreciated! Thank you.
I think you can be much more efficient than this. You are trying to do a web request, remote ontology download and search every time you encounter a URI that doesn't have a label given in http://www.bioassayontology.org/bao/bao_complete.owl which is most of them and it's a very large number. So your script will take forever and thrash the web servers delivering those remote ontologies.
Looking at http://www.bioassayontology.org/bao/bao_complete.owl, I see that most of the URIs without labels there are from OBO, and perhaps a couple of other ontologies, but mostly OBO.
What you should do is download OBO once and load that with RDFlib. Then if you run your script above on the joined (union) graph of http://www.bioassayontology.org/bao/bao_complete.owl & OBO, you'll have all OBO's content at your fingertips so that g.label(s) will find a much higher proportion of labels.
Perhaps there are a couple of other source ontologies providing labels for http://www.bioassayontology.org/bao/bao_complete.owl you may need as well but my quick browsing sees only OBO.

How do I dynamically add elements to the Roassal RTGrapher instance?

Object subclass: #MultiData
instanceVariableNames: 'b'
classVariableNames: ''
package: 'CFR-Extensions'
initialize
b := RTGrapher new.
b add: (self makeD: #('hello' 1 2 1)).
b add: (self makeD: #('test' 1 2 11)).
b
makeD: first
| d |
d := RTVerticalMultipleData new.
d barShape color: Color blue.
points := OrderedCollection new.
points add: first.
d points: points.
d addMetric: #second.
d addMetric: #third.
d addMetric: #fourth.
"Rotated text"
d barChartWithBarTitle: #first rotation: -30.
^d
The above is essentially the Several metrics per data point example from the Roassal book factored into two methods. Rather than just visualizing a static dataset I've been looking into ways of trying to add data as the program runs. I want to visualize the trace of the parameters for a tabular RL agent.
What happens when I display the graph in the inspector is that only the latest element shows up as a chart. There is some overlaying in the labels though that should not be there.
Originally I wanted to do something like pass an OrderedCollection of points, but the way RTVerticalMultipleData compiles them into Trachel elements makes such a scheme invalid, so I've thought to batch the data instead before adding it as an element.
The fact that the above does not work strikes me as a bug. Apart from fixing this, I am wondering if there is a better way to visualize dynamic data?
I don't know roassal enough to answer to your problem, but for dynamic visualizations, Pharo also has the Telescope project. (https://github.com/TelescopeSt/Telescope)
Currently, Telescope only works with Seaside via web visualization (With the Cytoscape connector: https://github.com/TelescopeSt/TelescopeCytoscape). See a demo at: https://demos.ferlicot.fr/TelescopeDemo
I don't know if web visualizations are fine with you but I share just in case.

Setting up a multiple dimensional parameter set in Origen?

I have been using the Origen parameters features and successfully created single dimension parameter sets dynamically as so:
pcie.define_params "pcie_demphasis_#{a}_logvar_#{v}".to_sym, inherit: :logvar_default do |p|
pcie.pcie_tx_p_pins.each_with_index do |(pin_id, pin_obj), i|
p.tm.send("Variable#{i}.Name=", "var name1")
end
end
Is there a way to chain these sends together? I have a 4-D data set that needs to be dynamically defined when importing data from Excel.
thx
Does this not work, or do you mean something else?
p.tm.send("blah").send("blah2").send("blah3=", "blah3_val")

Specify the specific heat of a material with Revit 2017 Python API

With Revit 2017 Python API, I am trying to create new materials, and then assembling some of these to create new type of walls.
It goes pretty well for all properties, except for the specific heat!
Basically, what I do is:
create a thermalAsset:
themalA = ThermalAsset('Test', ThermalMaterialType.Solid)
Set the different thermal properties for that thermal asset (dummy values):
thermalA.ThermalConductivity = 0.01
thermalA.SpecificHeat = 0.001
thermalA.Density = 1000.0
Then I create a PropertySetElement with that thermal asset:
pse = PropertySetElement.Create(doc, thermalA)
Then I assign it to my material (that I previously created):
mat.SetMaterialAspectByPropertySet(MaterialAspect.Thermal, pse)
Afetr that, I take a look in my materials list in Revit, and look at the thermal properties. Everything seems ok, except the Specific Heat, which remains at 0.0239 btu/(lb. F), whatever the value I input when I assign the specific heat. Density is ok, thermal conductivity is ok, but not specific heat.
I got no error message.
What am I missing?
Thanks a lot for any help.
Arnaud.
Is the value you specify in the expected unit? Feet per Kelvin, squared-second. Cf., http://thebuildingcoder.typepad.com/blog/2013/04/whats-new-in-the-revit-2014-api.html > ThermalAsset.SpecificHeat.
I submitted this to the development team for further analysis as issue REVIT-111206 [API: setting ThermalAsset SpecificHeat fails]. Can you please provide a full reproducible case for them to test, e.g., a minimal RVT model with an embedded macro to run, cf., http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b? Thank you!

Take mean of feature set using openSMILE audio feature extractor

My problem is taking mean of all features from different frames in one sample .wav file. I am trying cFunctionals in "chroma_fft.conf" file which belongs to latest OpenEar framework. For best explanation, i am writing these essential codes which i wrote in "chroma_fft.conf" and it is shown below;
[componentInstances:cComponentManager]
instance[functL1].type = cFunctionals
[functL1:cFunctional]
reader.dmLevel = chroma
writer.dmLevel = func
frameMode = full
frameSize=0
frameStep=0
functionalsEnabled = Means
Means.amean = 1
[csvSink:cCsvSink]
reader.dmLevel = func
..NOT-IMPORTANT......
..NOT-IMPORTANT......
However, when i run from command prompt in windows, i got error;
"(ERROR) [1] in configManager : base instance of field 'functL1.reader.dmInstance' not found in configmanager!"
Very similar code is running succesfully from "emo_large.conf" but this code got error. If any body knows how to use OpenSmile audio feature extractor, can give advice or answer why it has error and how to use "cFunctionals" properly to take mean, variance, moments etc. of large feature sets.
Thanks!
In this case you have a typo in
[functL1:cFunctional]
which should be
[functL1:cFunctionals]
I admit the error message
"(ERROR) [1] in configManager : base instance of field 'functL1.reader.dmInstance' not found in configmanager!"
is not intutive, but it refers to the fact that openSMILE expects a configuration section functL1 of type cFunctionals in the config to read the mandatory (sub-)field functL1.reader.dmInstance, which it then cannot find, because the section (due to the typo) is not defined.
Cheers,
Florian

Resources