SQL Meta Programming - metaprogramming

If I formulate a SQL-query with another language in my case Excel-VBA, could one call that Meta-Programming? Because as I understood it Meta-Programming means: "Code which writes other code".

Related

Functional decomposition vs use case

Functional decomposition is not used when applied to use case
modeling.
This phrase is a copied one from a question paper.What is the meaning of that phrase.
This is not equal to the question What is Functional Decomposition?
Use cases deal with synthesizing functions, not decomposing them. A technician decomposes a system to find the pieces it is built of. A business analyst tries to stack single parts of a system on piles so they are formed around a single goal. A use case describes a unique single piece of added value a systems gives to an actor. Indeed, functional decomposition is what most people try when describing use cases: finding bits and pieces. They all (like me) come from the programming guild where this is the daily job. But UC synthesis is working the exact opposite!
I recommend reading Bittner/Spence who explain this very complex approach in detail and very nicely.

Stanford NLP parsers and idioms that have common semantic meaning

I have parsed the following sentence in the Stanford CoreNLP demo page and the Stanford parser demo page. Although both result in a parse that can imply purpose semantics (hinging on the advcl and the sbar accordingly), clearly the parsers don't capture "in order to" as an expression whose meaning much transcends the relationships between its own word constituents (as in an idiom).
he went to the shop in order to buy food
What kind of parsing, or pre-processing stage, may yield "in order to" as a single unit of meaning, thus making it amenable to semantics derivation same as a preposition affords? e.g. "for" may commonly imply purpose semantics, and having "for" parse as a preposition assists in deriving purpose semantics.
As it currently stands, Stanford NLP does not allow this short of forking the code and fixing one nasty bug with your bare hands.

Declarative Domain Model possible (DDD)?

I'm looking for insight/ papers/ articles, etc. whether a fully declarative Domain Model (as per DDD) is possible.
For example:
Validation can be declarative (lot's of ORMs do this)
business flow logic can be declarative: having a DSL for defining a workflow / Finite State Machine / process manager / DDD Saga (whatever you want to call it) on Crud-operations, through ddd-repositories most likely
decision logic can be declarative. I.e: most of the time this boils down to simple conditionals
derived / calculated fields could be done declaratively but is as bit tricky, especially when this cascades. I.e: you'd have to keep a dependency graph on the calculated fields, etc. Still it can be done.
Any links to people having actually tried that, or some convincing couter-arguments why this can't be done?
p.s.: Please don't answer with "Yes it can be done, since a FSM is Turing-complete with enough memory bla bla"
"Everything is a nail if you hold a hammer"
Instead of asking if it is possible - ask:
What are the reasons I want to do this particular thing declaratively?
Data validation is a nice thing to do declaratively. You have a DTO, you add some attibutes, everything is clear and readable.
Business flow done declaratively... Reminds me of a great failure of Windows Workflow Foundation. Is anyone actually using it?
What is the benefit of making a behaviour-centric components in a declarative way? Imperative way seems to be well-fitted to this.
Decision logic... maybe. But again - why?
"derived / calculated fields could be done declaratively but is as bit tricky"
Why do you want to do tricky things when there is a way of achieving the same result with straightforward things?
So why?
Do you need to change the behaviour of the app in runtime by editing some config file? OK, go for it.
Do you have a generic domain that will be used by many clients and you need some reconfiguration to fit them? Ok, but you need to clearly distinguish the unchangeable core of your domain and the varying stuff. Don't try to make all the things configurable - you'll end up with Inner Platform syndrome.
Do you believe you can make a declarative language your client could use to change his domain without a need for a programmer? No. You will fail. I know a language which was supposed to be like this. An easy, declarative language that ordinary accountants would use to explore their data. It's called SQL :D
I fully concur with Bartłomiej Szypelow's remark. Regardless, I will try to answer your question.
A declarative language always depends on an imperative language for it to work. Take something as simple as arithmetic for example. When we ask for the outcome of 1+1 we first need to know how the 1 should be understood and how in that context the + operator can be calculated before the statement as a whole can be interpreted. This is one of the ways we are able to overcome complexity; you don't need to know how a plus operation is done to be able to use one.
From http://en.wikipedia.org/wiki/Imperative_programming:
Procedural programming could be considered a step towards declarative
programming. A programmer can often tell, simply by looking at the
names, arguments and return types of procedures (and related
comments), what a particular procedure is supposed to do, without
necessarily looking at the details of how it achieves its result. At
the same time, a complete program is still imperative since it 'fixes'
the statements to be executed and their order of execution to a large
extent.
In any domain the same applies. If you ask the flight attendant to reschedule your flight she knows what a flight and a passenger is and how to reschedule one. Creating a fully declarative flight scheduling domain model without describing how scheduling works is therefore impossible. Since all domain models contain operations/behavior it is therefore equally impossible to create a domain model in a declarative language unless your problem domain is not unique, for example when you have three flight companies that operate in similar fashion.
Back to why... you said:
Actually, the hypothetical reason why is actually to allow non-coders
to create a (trivial) backend by configuration
Declarative programming is not always simpler than imperative programming. Most of the time people tend to think in outcomes, but sometimes the outcomes are so varied that it is (much) simpler to think in steps. This is the reason why these different styles exist and continue to exist in the first place. The main difference between a coder and a non-coder is not that a non-coder tends to think in terms of outcomes instead of processes, but that the non-coder simply does not want to be bothered with the workings of a computer. The non-coder wants to focus on the problem. Depending on the domain a non-coder may be helped best with an imperative DSL, instead of an declarative DSL.

Natural Language to Sparql

I'm building a small prototype of a Movies semantic search engine based on the data of LinkedIMDB
I've defined some Query Types as an example of use cases
search by entity name search by
entity type
search common features between two entities ...etc
So far I've developed a SPARQL engine that takes any type of those Queries and send the Query to the endpoint and preview the result.
The problem here is that I want to make a natural language or semi natural language interface for it in order for users to invoke those sentences using Natural language search Queries. But I don't know from where to start.
I've found some papers that are trying to extract triplets from the text but I don't feel that's the key to the solution.
Also I've found some LSA techniques to interpret Natural language search Queries but I feel it's not applicable to semantic search domain.
Any idea or resources to start reading from?
Is there a best practice than the natural language interface?
A lot of work has been done in the field of natural languge -> SQL conversion. Maybe you should take that as a starting point and see how you can modify the available examples for SPARQL. (Also, designing a controlled natural language could make your task easier.)
Another path to explore can be this article: Supporting Domain Experts to Construct Conceptual Ontologies: A Holistic Approach published at the Journal of Web Semantics, http://www.websemanticsjournal.org/index.php/ps/article/view/189 Even though it is about using natural language for ontology construction, the approach explained there (along with open source code) can turn into a fruitful exploration.
Have you seen FREya # https://github.com/nmvijay/freya it is an NLP to SPARQL convertor.
FREyA is an interactive Natural Language Interface for querying ontologies which combines usability enhancement methods such as feedback and clarification dialogs in order to:
1) improve recall by generating the dialog and enriching the domain lexicon from the user's vocabulary, whenever an "unknown" term appears in a question
2) improve precision by resolving ambiguities more effectively through the dialog. The suggestions shown to the user are found through ontology reasoning and are initially ranked using the combination of string similarity and synonym detection. The system then learns from the user's selections, and improves its performance over time.

Which Cassandra API provides the highest level of abstraction?

There are a lot of Cassandra API:s available and usually the programming language preference determines the choice of API.
However, if we take the programming language component out of the equation, what Cassandra API provides the highest level of abstraction?
Definition of "level of abstraction" in this context: An API providing a lot of extra goodies such as index handling, etc would be considered being at a higher abstraction layer than a bare bones "close to Thrift" API.
I guess you have found the ClientExamples page on the wiki.
You probably want to take a closer look at OCM which claims the following: "higher level client built on Hector"

Resources