SPARQL query answers for Punned Entities in Ontology - ontology

I have built a small ontology in Protege to test punning with a SPARQL query. The Ontology is:
<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
xml:base="http://www.semanticweb.org/usr/ontologies/2022/2/untitled-ontology-88"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
ontologyIRI="http://www.semanticweb.org/usr/ontologies/2022/2/untitled-ontology-88">
<Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
<Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
<Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
<Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
<Declaration>
<Class IRI="#B"/>
</Declaration>
<Declaration>
<Class IRI="#CL"/>
</Declaration>
<Declaration>
<Class IRI="#E"/>
</Declaration>
<Declaration>
<Class IRI="#ES"/>
</Declaration>
<Declaration>
<Class IRI="#GE"/>
</Declaration>
<Declaration>
<Class IRI="#RLS"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#Lives_in"/>
</Declaration>
<Declaration>
<DataProperty IRI="#hasAge"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#CPZ"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#ES"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#GE"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Harry"/>
</Declaration>
<SubClassOf>
<Class IRI="#E"/>
<Class IRI="#B"/>
</SubClassOf>
<SubClassOf>
<Class IRI="#ES"/>
<Class IRI="#RLS"/>
</SubClassOf>
<SubClassOf>
<Class IRI="#GE"/>
<Class IRI="#E"/>
</SubClassOf>
<ClassAssertion>
<Class IRI="#ES"/>
<NamedIndividual IRI="#GE"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#GE"/>
<NamedIndividual IRI="#Harry"/>
</ClassAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#Lives_in"/>
<NamedIndividual IRI="#Harry"/>
<NamedIndividual IRI="#CPZ"/>
</ObjectPropertyAssertion>
</Ontology>
<!-- Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi -->
And the SPARQL query that i am using to test the pun entity (GE) is:
SELECT ?y ?x ?z
WHERE {
?x a ?y.
?z a ?x.
?z :Lives_in :CPZ.
}
An the output that i am getting is:
my question is why I am getting 6 answers instead of the first one in output? and what does the other 5 bindings of ?y(owl:Class and owl:NamedIndividual) mean?
Thank you!

Harry is a GE, from your assertions. GE is both a class and an individual; so GE appears in other statements as well, and that's multiplying the answers you're seeing. It's analogous as joining across tables where the join value matches multiple rows in one of the tables involved.

Related

Error in ROS: Controller Spawner couldn't find the expected controller_manager ROS interface

I am getting this error:
[WARN] [1549645986.850056, 54.996000]: Controller Spawner couldn't find the expected controller_manager ROS interface
while launching a urdf in gazebo. I am using ROS Kinetic and have looked for a solution for this error everywhere but couldn't find it. A similar question is asked here. I have done everything suggested in that link and the libjoint_state_controller.so file is present at opt/ros/kinetic/lib. I have added the gazebo plugin in my .xacro file.
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/mushak</robotNamespace>
<robotParam>/mushak/robot_description</robotParam>
</plugin>
</gazebo>
This is the .launch file:
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<group ns="/mushak">
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find mushak_pkg)/urdf/mushak_model.xacro'" />
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0.2412"/>
<!-- Spawn the robot model -->
<node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model mushak -x $(arg x) -y $(arg y) -z $(arg z)" />
<!-- Load controllers -->
<rosparam command="load" file="$(find mushak_pkg)/config/config.yaml" />
<!-- Controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner"
respawn="false" output="screen" ns="/mushak"
args="
joint_state_controller
joint1_position_controller
joint2_position_controller
joint3_position_controller
joint4_position_controller
joint5_position_controller
joint6_position_controller
--timeout 50
">
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
respawn="false" output="screen">
<remap from="/joint_states" to="/mushak/joint_states" />
</node>
</group>
</launch>
The model is opening in rviz without any error. The following is the output when I run rospack find joint_state_controller .
/opt/ros/kinetic/share/joint_state_controller
Also, in the terminal in which the Gazebo is running the following error is shown:
[ERROR] [1550681387.800721476, 9.313000000]: GazeboRosControlPlugin missing while using DefaultRobotHWSim, defaults to true.
This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead.
If you do not want to fix this issue in an old package just set to true.
I have added the transmissions to all the joints:
<transmission name="trans_${name}">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${name}">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="motor_${name}">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
Can someone help me with this please!

TestNG results in Jenkins is showing PASS even if script is changed to generate failed result

I have uploaded the testng-results.xml in a git branch and am using the git repository as a workspace for the Jenkins job.
Since the tests I run on Jenkins are regression tests I would expect the TestNG reports to vary in any event there was a regression defect. I noticed that the TestNG reports displayed on Jenkins is just a readable version of the testng-results.xml file i.e. its a exact copy of the testng-results.xml file in my workspace.
I have changed the test script ChromeTest.f() to purposely fail and still the TestNG results in Jenkins marks it as PASS as per below image:
.
Please find the testng-results.xml file below:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="0" ignored="0" total="9" passed="9">
<reporter-output>
</reporter-output>
<suite name="Default suite" duration-ms="159837" started-at="2017-09-12T16:48:30Z" finished-at="2017-09-12T16:51:10Z">
<groups>
</groups>
<test name="Default test" duration-ms="159837" started-at="2017-09-12T16:48:30Z" finished-at="2017-09-12T16:51:10Z">
<class name="IETests">
<test-method status="PASS" signature="beforeTest()[pri:1, instance:IETests#7921b0a2]" name="beforeTest" duration-ms="18341"
started-at="2017-09-12T09:48:30Z" finished-at="2017-09-12T09:48:49Z">
<reporter-output>
</reporter-output>
</test-method> <!-- beforeTest -->
<test-method status="PASS" signature="f()[pri:2,
instance:IETests#7921b0a2]" name="f" duration-ms="99893" started-
at="2017-09-12T09:48:49Z" finished-at="2017-09-12T09:50:29Z">
<reporter-output>
</reporter-output>
</test-method> <!-- f -->
<test-method status="PASS" signature="afterTest()[pri:3,
instance:IETests#7921b0a2]" name="afterTest" duration-ms="115"
started-at="2017-09-12T09:50:29Z" finished-at="2017-09-12T09:50:29Z">
<reporter-output>
</reporter-output>
</test-method> <!-- afterTest -->
</class> <!-- IETests -->
<class name="ChromeTest">
<test-method status="PASS" signature="beforeTest()[pri:4,
instance:ChromeTest#1efbd816]" name="beforeTest" duration-ms="12606"
started-at="2017-09-12T09:50:29Z" finished-at="2017-09-12T09:50:41Z">
<reporter-output>
</reporter-output>
</test-method> <!-- beforeTest -->
<test-method status="PASS" signature="f()[pri:5,
instance:ChromeTest#1efbd816]" name="f" duration-ms="1087" started-
at="2017-09-12T09:50:41Z" finished-at="2017-09-12T09:50:42Z">
<reporter-output>
</reporter-output>
</test-method> <!-- f -->
<test-method status="PASS" signature="afterTest()[pri:6,
instance:ChromeTest#1efbd816]" name="afterTest" duration-ms="243"
started-at="2017-09-12T09:50:43Z" finished-at="2017-09-12T09:50:43Z">
<reporter-output>
</reporter-output>
</test-method> <!-- afterTest -->
</class> <!-- ChromeTest -->
<class name="FirefoxTest">
<test-method status="PASS" signature="beforeTest()[pri:7,
instance:FirefoxTest#6a2bcfcb]" name="beforeTest" duration-ms="24220"
started-at="2017-09-12T09:50:43Z" finished-at="2017-09-12T09:51:07Z">
<reporter-output>
</reporter-output>
</test-method> <!-- beforeTest -->
<test-method status="PASS" signature="f()[pri:8,
instance:FirefoxTest#6a2bcfcb]" name="f" duration-ms="3212" started-
at="2017-09-12T09:51:07Z" finished-at="2017-09-12T09:51:10Z">
<reporter-output>
</reporter-output>
</test-method> <!-- f -->
<test-method status="PASS" signature="afterTest()[pri:9,
instance:FirefoxTest#6a2bcfcb]" name="afterTest" duration-ms="83"
started-at="2017-09-12T09:51:10Z" finished-at="2017-09-12T09:51:10Z">
<reporter-output>
</reporter-output>
</test-method> <!-- afterTest -->
</class> <!-- FirefoxTest -->
</test> <!-- Default test -->
</suite> <!-- Default suite -->
</testng-results>
Jenkins is just triggering the test in command line and then, like you mention parsing and displaying the xml results file.
Try to run it out of Jenkins, say using Maven, do you see that it fails as you expect? if so, the issue is not related to Jenkins itself and I would concentrate on the test code itself
I solved my problem by using Maven and Junit testing tools.
Also I added my entire project workspace in git before running the test.
After the build ran in Jenkins I could see the results for each build.
Thank you all for helping

How can I view a Cobertura code coverage report?

I have a coverage report generated with Karma / Cobertura.
It looks like this:
<?xml version="1.0" ?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage lines-valid="91293" lines-covered="22464" line-rate="0.24609999999999999" branches-valid="50346" branches-covered="3333" branch-rate="0.0662" timestamp="1478206709367" complexity="0" version="0.1">
<sources>
<source>/home/ubuntu/my-website</source>
</sources>
<packages>
<package name="core" line-rate="0.4032" branch-rate="0.2327" >
<classes>
<class name="ajax.js" filename="src/ajax.js" line-rate="0.4576" branch-rate="0.2778" >
<methods>
<method name="(anonymous_1)" hits="1" signature="()V" >
<lines><line number="7" hits="1" /></lines>
</method>
...
How can I use this file to view annotated code?

Parse test name from testng xml to ant build.xml

There are many testng.xml files which I run via same build.xml using command line option.
I want build.xml to parse the test name from each testng.xml that is passed via command line option
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="tests" verbose="1" threads="10" preserve-order="true">
<test name="first" preserve-order="true">
<classes>
<class name="com.etc.first">
<methods>
<include name="First" />
</methods>
</class>
</classes>
</test>
<test name="second" preserve-order="true">
<classes>
<class name="com.etc.Second.java">
<methods>
<include name="Req" />
</methods>
</class>
</classes>
</test>
</suite>

How show stacktrace in testng-plugin of Jenkins?

I have a jenkins Job that have a script that writes an xml report. The xml is equal to this example:
<testng-results>
<reporter-output>
</reporter-output>
<suite name="suite0" failures="0" tests="0">
<test name="testcase1">
<class name="testcase1.class">
<test-method name="test1" started-at="2013-10-07T16:20:51Z" finished-at="2013-10-07T16:20:53Z" duration-ms="2754" status="PASS">
</test-method>
</class>
</test>
<test name="test2">
<class name="test2.class">
<test-method name="testcase2" started-at="2013-10-07T16:21:14Z" finished-at="2013-10-07T16:21:19Z" duration-ms="4163" status="FAIL">
<short-stacktrace>description of the error with a lot of information....
</short-stacktrace>
</test-method>
</class>
</test>
</suite>
</testng-results>
This xml is readed by the testNgplugin and shows me the tests with duration, nº of fails and passed. But the failed tests doesn't show me the stacktrace...¿There is a way to show the description of the error to the user in Jenkins? What tag must i use?

Resources