FAQ Database Discussion Community


Get geographical coordinates of a particular place from DbPedia

sparql,semantics,ontology,dbpedia
I need to get the co-ordinates of some particular places from DbPedia. For the same I am using following snippet: PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT * WHERE { ?x foaf:name 'Mumbai'. ?x dbo:Place 'Mumbai'. ?x geo:lat ?lat . ?x geo:long ?long . } On running...

OWL. How to express that siblings has common parent?

rdf,semantics,semantic-web,owl
I wrote simple file in turtle notation where Dave is father of Mary and Mary sister of Jack. I want reason that Dave have two childs Jack and Mary. :Human a rdfs:Class . :Man rdfs:subClassOf :Human ; owl:disjointWith :Woman . :Woman rdfs:subClassOf :Human ; owl:disjointWith :Man . :hasChild a rdf:Property...

signal local to process scope

vhdl,grammar,semantics
I have often wondered why a VHDL variable can be declared both on the process as well as the architecture (as shared) level, while a signal can only be declared on the architecture level - even if it is just used in the scope of a single process. Declaring things...

If key in dictionary returning false when key exists

python,if-statement,semantics
Python 3.2 This might be really stupid but: items = {'1': 'ACK', '2': 'RELQ', '3': 'COM'} choice = input('Choose an option:\n1.ACK\n2.RELQ\n3.COM\n') print(choice) if choice in items: print(choice) option = items[choice] else: print('Input not recognized') If you type 1 it keeps returning 1 Input not recognized The choice in items is...

How to determine the corresponding language of a grammar?

semantics,context-free-grammar,syntactic-sugar
I have the following grammar that uses center embedded recursion. However, it has two cases using an or: S-> aSbbb | aSbb | ϵ where ϵ is an empty set. Is there a way to generate a comprehensive mathematical formula (Language) that determines that grammar?

The h1 in the structure of a page

html,html5,structure,semantics
(I am not sure if this is the right place to ask this question, if not please suggest the appropriate forum) I have a very simple structure in the page: <nav> <h2>Menu</h2> <ul> <li>first</li> <li>second</li> </ul> </nav> <h1>This is the h1</h1> <p>This is a paragraph</p> <h2>This is the h2</h2> <p>This...

HTML - How to properly mark a phrase

html5,semantics
The <blockquote> tag demand a cite external source, but what if the only source is the name of the phrase author? The <cite> tag defines the name of a work (e.g. a book, a song, a movie, a TV show, a painting, a sculpture, etc.), so it's no suitable to...

Describe a film (entity and attribute) using the first order logic

logic,semantics,semantic-web,first-order-logic
Good morning, I want to understand how can I describe something using the first order logic. For example I want to describe what is a film (an entity) and what is an attribute (for example actor: Clooney) for the film. How can I describe that using the first order logic?...

Javascript if statement if (ball.style.left === '0px') {

javascript,css,if-statement,equals,semantics
I think the problem is really simple, but I'm not seeing it. I just want to move the "ball" to the left 132.5px when I click the "dice" and if the ball is 0px left. I think the if statement is wrong!! Can someone help me? var ball = document.getElementById('ball');...

What's this Coffescript use of then?

syntax,coffeescript,semantics
In Trevor Burnham's book on Coffeescript (p81) he has newcard.save().then => ... Which is not part of a conditional or a switch statement. Is then just a joining word for the syntax or does it have a semantic purpose?...

How to notate that the parameter value doesn't matter in a JUnit test?

java,junit,tdd,semantics,hamcrest
I'm doing some TDD using JUnit4, Mockito, and Hamcrest. My current test looks like this: FeatureFilter featureFilter = FeatureFilter .describeFeature() .addFeatureRef("myNewFeature", thatIsAvailable() .atEndpoint("/resourceWithFeature")) .andDisable(); assertThat(featureFilter.isDisabledFor("/resourceWithFeature", null, "myNewFeature"), is(true)); assertThat(featureFilter.isDisabledFor("/irrelevant", null, "myNewFeature"), is(false)); assertThat(featureFilter.isDisabledFor("/resourceWithFeature", null, "self"), is(false)); The...

Virtuoso 37000 Error SP030

sparql,semantics,semantic-web,virtuoso
why is showing this error, i see in the sparql query is correct, i don't see any mistake in prefix. PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX type: <http://dbpedia.org/class/yago/> PREFIX prop: <http://dbpedia.org/property/> SELECT ?country_name ?population WHERE { ?country rdf:type dbpedia-owl:Country; rdfs:label ?country_name ; prop:populationEstimate ?population . FILTER (?population > 2334456) . FILTER ( lang(?country_name)...

Swift: Default property vs setting in initializer

swift,methods,properties,semantics
Is there any drawback in swift to using a default property value instead of setting it in the initializer? e.g., class Foo: UIViewController { let value = UIRefreshControl() } vs. class Bar: UIViewController { var value : UIRefreshControl! // or using init() override func viewDidLoad() { self.value = UIRefreshControl() }...

What is the semantic HTML tag to display for URLs that are not links?

html,html5,url,tags,semantics
I have a search engine plugin that outputs results in a basic structure: <a href="page url"> <div class="searchResult"> <h3>Page title</h3> <p>Page url</p> <p>Page <meta> description</p> </div> </a> The plugin is designed to integrate into an existing website so it has no default styling. However, websites are supposed to be usable...

Why can an instance of a class access private fields of another instance of its own type?

java,semantics,dsl
An instance of a class, in Java, can access private fields of a different instance of its own type, such as in the following listing: public class Foo { private int secret; public void bar(final Foo foo) { foo.secret = 100; } } What would be the argument for such...

MarkLogic 8 - SPARQL - Follow synonym chain

sparql,semantics,marklogic
Let's say I have lots of ontologies with synonyms. <term> <word>cat</word> <synonyms> <synonym>feline</synonym> </synonyms> </term> <term> <word>feline></word> <synonyms> <synonym>kitty</synonym> <synonyms> </term> How can I write a SPARQL query such that I can give it the word cat and it will give me all the synonyms of cat as well as...

Using both date and duration in html5

html,html5,datetime,time,semantics
I have a list of events, each of which has a start date and an end date and I would like to use the html5 <time> element to make the list semantically richer. I have found that I can use the datetime attribute to provide a machine-readable time like so:...

Semantics - creating grammar in NLTK

python,nltk,semantics,context-free-grammar
I'm trying to expand the simple-sem.fcfg (link here: https://github.com/nltk/nltk_teach/blob/master/examples/grammars/book_grammars/simple-sem.fcfg) so that it supports coordination of phrases. I want it to successfully parse a sentence like: Irene walks and Angus barks. Since this is represented as walk(Irene) & bark(Angus), I think the best way to achieve this is by adding a...

Consequence of restrictions in ontology on SPARQL end results

rdf,sparql,semantics,owl,ontology
I am concerned about two classes (SensingDevice and Property) of my ontology (dgo.owl) as shown in the below figure. These two classes are connected by observes property: and the related ontology portion is as: <owl:Class rdf:about="http://www.iiitd.edu.in/~haroonr/ontologies/DGO#TemperatureSensor_Livingroom"> <rdfs:subClassOf rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#SensingDevice"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#observes"/>...

Protege Equivalent to query

sparql,semantics,semantic-web,protege4
Please help to list all Mealcourse from the wine Ontology or happy to receive useful links like this one :Sparql query on restriction list (Equivalent To) in protégé MealCourse and (hasFood value Pizza) and(hasDrink value Wine) Thank you...

Conflicting layouts prevents semantic html

html,css,html5,semantics
If there are two layouts for the same data should I try to find a semantic layout that fits both or just pick one to be semantic and the other stylistic only? Any ideas would be appreciated since at the moment, I'm doing neither. I'm trying to put some sacred...

What is Semantic Wiki?

php,semantics,wiki,semantic-web,semantic-mediawiki
I am a PHP Developer and completely new about the terms like Semantic Web, Semantic Wiki, Semantic MediaWiki etc. Got the work requirement about Semantic Wiki couple of days before and then I explored lot about it but didn't get exact idea about it. Still confused..!!! and I've some doubt...

Date modelling using ontology concepts

rdf,semantics,owl,ontology,protege
Problem: I need to create an ontology (say www.example.com/ontology/ont# , with ONT prefix). This ontology consists of some other ontologies with prefixes as SSN, TIME, GEO, etc. Now, the confusion is that when I use ONT ontology for data modelling, should I use original prefix’s such as SSN,TIME and GEO...

Ambiguity in the standard on undefined behaviour of out of range pointer

c++,c++11,language-lawyer,semantics,undefined-behavior
ISO IEC 14882-2011 §5.7/5 States: If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined. This section is used here on stackoverflow...

Material Design: Button or Edit Text?

android,android-edittext,semantics,android-button,material-design
I have a question about Material Design and semantics. I try to make the settings of my application and I have only a few fields. So I first try to make the UI like this one, with a LinearLayout and some EditText: I have to set hour, and I have...

Does CSS affects HTML sematics?

html,css,html5,semantics
Does CSS affects HTML semantics? For example, Hiding the bullets of ordered list (<ol><li>) and using an image instead. Will it be treated like unordered list after applying the CSS? Thanks!...

include semantic images with php if view port is larger than 1024px

php,html,image,include,semantics
I have been searching for a solution to help improve mobile first responsive websites performance. The problem: I need to make SEO friendly inline images for a website. One thing I did was using picturefill.js to serve smaller images for smaller devices. But... In the design I got from the...

Using an ontology to produce semantic full information from the raw data

sparql,jena,semantics,ontology,rdfs
Problem Definition: Store sensor data (temperature readings, sensor description) into rdf form using an ontoloy. Further, use SPARQL to perform queries on stored data. My Approach: I am not an expert in this domain, but I have some basic understanding and accordingly I am using this approach: 1. Create Ontology,...

R: Parsing ConceptNet5 syntax into Data frame

r,semantics
I have been going at this for a few hours now with grep and gsub but I feel like I am not really approaching this problem correctly. I am using an amazing publicly available dataset ConceptNet5 which maps connection between concepts (which I found on the Open Data community). The...

Is using a HTML Label to wrap elements semantic?

html,html5,validation,semantics
I'm considering using a label to wrap a h3 and a p tag. In my mind this makes sense as the label has a heading and description and both relate to the input. However I can't seem to find any info in the spec on whether this can be done....

SPDY on shared host & SEO Sematics

seo,semantics,shared-hosting,spdy,http2
NodeSPDY on shared host I got a webspace hosted by uberspace and want to use NodeSPDY, but there is a loadbalancer in between which cuts off the tls connection. On uberspace one can request a Port to be opened. With this port it is possible to request resources directly by...